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>
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;
*datap++ = chan;
s->readback[chan] = val;
}
- async->events |= COMEDI_CB_BLOCK;
}
/* if command is still running, resubmit urb */