staging: comedi: usbdux: use comedi_buf_write_samples()

Use comedi_buf_write_samples() to add the sample to the async buffer.

The async events COMEDI_CB_BLOCK and COMEDI_CB_EOS will be detected and set
by the core. Remove the unnecessary events in the driver.

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>
This commit is contained in:
H Hartley Sweeten 2014-10-22 15:37:07 -07:00 committed by Greg Kroah-Hartman
parent 5023a4bb10
commit 290d028e04
1 changed files with 1 additions and 2 deletions

View File

@ -282,10 +282,9 @@ static void usbduxsub_ai_handle_urb(struct comedi_device *dev,
val ^= ((s->maxdata + 1) >> 1);
/* transfer data */
if (!comedi_buf_put(s, val))
if (!comedi_buf_write_samples(s, &val, 1))
return;
}
async->events |= COMEDI_CB_BLOCK | COMEDI_CB_EOS;
}
/* if command is still running, resubmit urb */