staging: comedi: usbdux: use comedi_buf_write_samples()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 22 Oct 2014 22:37:07 +0000 (15:37 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2014 08:03:15 +0000 (16:03 +0800)
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>
drivers/staging/comedi/drivers/usbdux.c

index 53f1e218d0d9bba04303e1d32717979e8a522f2f..579e6bce529dcedc5dc06b5bd81e38cc3cf7847d 100644 (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 */