Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abafc9e8 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman
Browse files

staging: comedi: s626: cleanup "subdevice" and "cmd" in s626_irq_handler()



The comedi_subdevice in this function is actually the dev->read_subdev
that was initialized during the attach of the board. Use that instead
of accessing the dev->subdevices array directly.

Also, get the comedi_cmd used in s626_irq_handler() when the function
is first entered.

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 65a17c29
Loading
Loading
Loading
Loading
+2 −10
Original line number Original line Diff line number Diff line
@@ -731,8 +731,8 @@ static irqreturn_t s626_irq_handler(int irq, void *d)
{
{
	struct comedi_device *dev = d;
	struct comedi_device *dev = d;
	struct s626_private *devpriv = dev->private;
	struct s626_private *devpriv = dev->private;
	struct comedi_subdevice *s;
	struct comedi_subdevice *s = dev->read_subdev;
	struct comedi_cmd *cmd;
	struct comedi_cmd *cmd = &s->async->cmd;
	struct enc_private *k;
	struct enc_private *k;
	unsigned long flags;
	unsigned long flags;
	int32_t *readaddr;
	int32_t *readaddr;
@@ -760,10 +760,6 @@ static irqreturn_t s626_irq_handler(int irq, void *d)


	switch (irqtype) {
	switch (irqtype) {
	case IRQ_RPS1:		/*  end_of_scan occurs */
	case IRQ_RPS1:		/*  end_of_scan occurs */
		/*  manage ai subdevice */
		s = dev->subdevices;
		cmd = &(s->async->cmd);

		/* Init ptr to DMA buffer that holds new ADC data.  We skip the
		/* Init ptr to DMA buffer that holds new ADC data.  We skip the
		 * first uint16_t in the buffer because it contains junk data from
		 * first uint16_t in the buffer because it contains junk data from
		 * the final ADC of the previous poll list scan.
		 * the final ADC of the previous poll list scan.
@@ -808,10 +804,6 @@ static irqreturn_t s626_irq_handler(int irq, void *d)
		comedi_event(dev, s);
		comedi_event(dev, s);
		break;
		break;
	case IRQ_GPIO3:	/* check dio and conter interrupt */
	case IRQ_GPIO3:	/* check dio and conter interrupt */
		/*  manage ai subdevice */
		s = dev->subdevices;
		cmd = &(s->async->cmd);

		/* s626_dio_clear_irq(dev); */
		/* s626_dio_clear_irq(dev); */


		check_dio_interrupts(dev);
		check_dio_interrupts(dev);