]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: comedi: hwdrv_apci3120: use comedi_buf_write_samples()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Wed, 22 Oct 2014 22:37:08 +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 samples to the async buffer.

The COMEDI_CB_EOS and COMEDI_CB_OVERFLOW events will be automatically
handled by the core. Remove the unecessary handling 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/addi-data/hwdrv_apci3120.c

index 4959fc663d85b6f792708fcaf5aea8718b5093fe..975ee5fc93dc4db14b7d942cea6cfef2368170b1 100644 (file)
@@ -1313,18 +1313,13 @@ static int apci3120_interrupt_handle_eos(struct comedi_device *dev)
 {
        struct apci3120_private *devpriv = dev->private;
        struct comedi_subdevice *s = dev->read_subdev;
-       int n_chan, i;
-       int err = 1;
-
-       n_chan = devpriv->ui_AiNbrofChannels;
-
-       for (i = 0; i < n_chan; i++)
-               err &= comedi_buf_put(s, inw(dev->iobase + 0));
-
-       s->async->events |= COMEDI_CB_EOS;
+       unsigned short val;
+       int i;
 
-       if (err == 0)
-               s->async->events |= COMEDI_CB_OVERFLOW;
+       for (i = 0; i < devpriv->ui_AiNbrofChannels; i++) {
+               val = inw(dev->iobase + 0);
+               comedi_buf_write_samples(s, &val, 1);
+       }
 
        return 0;
 }