From: H Hartley Sweeten Date: Wed, 22 Oct 2014 21:36:45 +0000 (-0700) Subject: staging: comedi: usbdux: use comedi_buf_read_samples() X-Git-Tag: firefly_0821_release~176^2~2665^2~785 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=664ab5d6db57c5805ed3e1bfc06f39aad80ce34e;p=firefly-linux-kernel-4.4.55.git staging: comedi: usbdux: use comedi_buf_read_samples() 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c index eae441f3858c..53f1e218d0d9 100644 --- a/drivers/staging/comedi/drivers/usbdux.c +++ b/drivers/staging/comedi/drivers/usbdux.c @@ -413,7 +413,7 @@ static void usbduxsub_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; @@ -425,7 +425,6 @@ static void usbduxsub_ao_handle_urb(struct comedi_device *dev, *datap++ = chan << 6; s->readback[chan] = val; } - async->events |= COMEDI_CB_BLOCK; } /* if command is still running, resubmit urb for BULK transfer */