[PATCH 13/18] staging: comedi: usbduxsigma: use comedi_buf_read_samples()

H Hartley Sweeten hsweeten at visionengravers.com
Mon Oct 20 18:52:17 UTC 2014


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 at visionengravers.com>
Cc: Ian Abbott <abbotti at mev.co.uk>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
 drivers/staging/comedi/drivers/usbduxsigma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c
index 1d12cc6..de3fb41 100644
--- a/drivers/staging/comedi/drivers/usbduxsigma.c
+++ b/drivers/staging/comedi/drivers/usbduxsigma.c
@@ -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 */
-- 
2.0.3



More information about the devel mailing list