staging: comedi: usbduxsigma: use comedi_buf_read_samples()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 22 Oct 2014 21:36:46 +0000 (14:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2014 08:01:20 +0000 (16:01 +0800)
Use comedi_buf_read_samples() to read the analog output samples from
the async buffer. That function will set the COMEDI_CB_BLOCK event
when samples are read from the async buffer.

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/usbduxsigma.c

index 1d12cc6c1ade8934db96f1248b2ad7fe7d8e31ad..de3fb41b188648dde7fd21963b1c4910294ef0f3 100644 (file)
@@ -374,7 +374,7 @@ static void usbduxsigma_ao_handle_urb(struct comedi_device *dev,
                        unsigned int chan = CR_CHAN(cmd->chanlist[i]);
                        unsigned short val;
 
-                       if (!comedi_buf_get(s, &val)) {
+                       if (!comedi_buf_read_samples(s, &val, 1)) {
                                dev_err(dev->class_dev, "buffer underflow\n");
                                async->events |= COMEDI_CB_OVERFLOW;
                                return;
@@ -384,7 +384,6 @@ static void usbduxsigma_ao_handle_urb(struct comedi_device *dev,
                        *datap++ = chan;
                        s->readback[chan] = val;
                }
-               async->events |= COMEDI_CB_BLOCK;
        }
 
        /* if command is still running, resubmit urb */
This page took 0.030249 seconds and 5 git commands to generate.