diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-10-22 15:37:12 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-10-29 16:03:15 +0800 |
commit | dbe81a93f499345499d7f06ba2893af7cc881053 (patch) | |
tree | cfb320a797b2dfb8694f4cf4d6a7dbac5886712f | |
parent | 2a07616cd9d5482c8388b8c4762b51f7ec02ba42 (diff) | |
download | linux-dbe81a93f499345499d7f06ba2893af7cc881053.tar.bz2 |
staging: comedi: ni_pcidio: use comedi_buf_write_samples()
Use comedi_buf_write_samples() to add the sample to the async buffer. The 32-bit
sample size is automatically determined due to the subddev_flag SDF_LSAMPL.
The async event COMEDI_CB_BLOCK will be automatically set by the core. Remove the
unnecessary event in the driver.
This driver also has the SDF_PACKED subdev_flag set so the core will automatically
set the COMEDI_CB_EOS event after adding the sample.
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>
-rw-r--r-- | drivers/staging/comedi/drivers/ni_pcidio.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c b/drivers/staging/comedi/drivers/ni_pcidio.c index 0bb776366264..db7e8aac67b5 100644 --- a/drivers/staging/comedi/drivers/ni_pcidio.c +++ b/drivers/staging/comedi/drivers/ni_pcidio.c @@ -384,11 +384,7 @@ static irqreturn_t nidio_interrupt(int irq, void *d) struct comedi_subdevice *s = dev->read_subdev; struct comedi_async *async = s->async; struct mite_struct *mite = devpriv->mite; - - /* int i, j; */ - unsigned int auxdata = 0; - unsigned short data1 = 0; - unsigned short data2 = 0; + unsigned int auxdata; int flags; int status; int work = 0; @@ -451,13 +447,9 @@ static irqreturn_t nidio_interrupt(int irq, void *d) goto out; } auxdata = readl(dev->mmio + Group_1_FIFO); - data1 = auxdata & 0xffff; - data2 = (auxdata & 0xffff0000) >> 16; - comedi_buf_put(s, data1); - comedi_buf_put(s, data2); + comedi_buf_write_samples(s, &auxdata, 1); flags = readb(dev->mmio + Group_1_Flags); } - async->events |= COMEDI_CB_BLOCK; } if (flags & CountExpired) { |