Commit e463fbe4 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: usbduxsigma: 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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 664ab5d6
...@@ -374,7 +374,7 @@ static void usbduxsigma_ao_handle_urb(struct comedi_device *dev, ...@@ -374,7 +374,7 @@ static void usbduxsigma_ao_handle_urb(struct comedi_device *dev,
unsigned int chan = CR_CHAN(cmd->chanlist[i]); unsigned int chan = CR_CHAN(cmd->chanlist[i]);
unsigned short val; 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"); dev_err(dev->class_dev, "buffer underflow\n");
async->events |= COMEDI_CB_OVERFLOW; async->events |= COMEDI_CB_OVERFLOW;
return; return;
...@@ -384,7 +384,6 @@ static void usbduxsigma_ao_handle_urb(struct comedi_device *dev, ...@@ -384,7 +384,6 @@ static void usbduxsigma_ao_handle_urb(struct comedi_device *dev,
*datap++ = chan; *datap++ = chan;
s->readback[chan] = val; s->readback[chan] = val;
} }
async->events |= COMEDI_CB_BLOCK;
} }
/* if command is still running, resubmit urb */ /* if command is still running, resubmit urb */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment