staging: comedi: cb_pcidas: use comedi_cmd pointer
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 27 May 2014 17:30:50 +0000 (10:30 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 May 2014 21:28:53 +0000 (14:28 -0700)
Use the local variable to access the comedi_cmd as a pointer instead
of getting to it from the comedi_async pointer.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/cb_pcidas.c

index 7b029596b11f77b66610d63af594221e70fa5775..7377da1aff7c984a2a6a28531140da49a9c416dd 100644 (file)
@@ -1321,7 +1321,7 @@ static void handle_ao_interrupt(struct comedi_device *dev, unsigned int status)
                                               num_points * sizeof(short));
                num_points = num_bytes / sizeof(short);
 
-               if (async->cmd.stop_src == TRIG_COUNT)
+               if (cmd->stop_src == TRIG_COUNT)
                        devpriv->ao_count -= num_points;
                /*  write data to board's fifo */
                outsw(devpriv->ao_registers + DACDATA, devpriv->ao_buffer,
@@ -1343,6 +1343,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
        struct cb_pcidas_private *devpriv = dev->private;
        struct comedi_subdevice *s = dev->read_subdev;
        struct comedi_async *async;
+       struct comedi_cmd *cmd;
        int status, s5933_status;
        int half_fifo = thisboard->fifo_size / 2;
        unsigned int num_samples, i;
@@ -1353,6 +1354,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
                return IRQ_NONE;
 
        async = s->async;
+       cmd = &async->cmd;
 
        s5933_status = inl(devpriv->s5933_config + AMCC_OP_REG_INTCSR);
 
@@ -1375,7 +1377,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
        if (status & ADHFI) {
                /*  read data */
                num_samples = half_fifo;
-               if (async->cmd.stop_src == TRIG_COUNT &&
+               if (cmd->stop_src == TRIG_COUNT &&
                    num_samples > devpriv->count) {
                        num_samples = devpriv->count;
                }
@@ -1384,7 +1386,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
                cfc_write_array_to_buffer(s, devpriv->ai_buffer,
                                          num_samples * sizeof(short));
                devpriv->count -= num_samples;
-               if (async->cmd.stop_src == TRIG_COUNT && devpriv->count == 0)
+               if (cmd->stop_src == TRIG_COUNT && devpriv->count == 0)
                        async->events |= COMEDI_CB_EOA;
                /*  clear half-full interrupt latch */
                spin_lock_irqsave(&dev->spinlock, flags);
@@ -1399,7 +1401,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
                                        INT_ADCFIFO)) == 0)
                                break;
                        cfc_write_to_buffer(s, inw(devpriv->adc_fifo));
-                       if (async->cmd.stop_src == TRIG_COUNT &&
+                       if (cmd->stop_src == TRIG_COUNT &&
                            --devpriv->count == 0) {
                                /* end of acquisition */
                                async->events |= COMEDI_CB_EOA;