summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2014-10-22 15:37:10 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-10-29 16:03:15 +0800
commit4c704690e743200de94526938cb03cf80c5ae0c3 (patch)
tree93d0ac9ea5b61ee91d6a1e29a1651dc818681b21
parent435efc8a43330d957cf6e8b79f8e98317668a895 (diff)
downloadop-kernel-dev-4c704690e743200de94526938cb03cf80c5ae0c3.zip
op-kernel-dev-4c704690e743200de94526938cb03cf80c5ae0c3.tar.gz
staging: comedi: addi_apci_2032: use comedi_buf_write_samples()
The dev->read_subdev used in this driver for async commands returns the full scan with each sample so it should have the SDF_PACKED subdev_flag set. Add the missing subdev_flags and use comedi_buf_write_samples() to add the sample to the async buffer. The core sets the async events appropriately. Remove the unnecessary event 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>
-rw-r--r--drivers/staging/comedi/drivers/addi_apci_2032.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_2032.c b/drivers/staging/comedi/drivers/addi_apci_2032.c
index ad75294..7a5659f 100644
--- a/drivers/staging/comedi/drivers/addi_apci_2032.c
+++ b/drivers/staging/comedi/drivers/addi_apci_2032.c
@@ -211,8 +211,7 @@ static irqreturn_t apci2032_interrupt(int irq, void *d)
bits |= (1 << i);
}
- if (comedi_buf_put(s, bits)) {
- s->async->events |= COMEDI_CB_BLOCK | COMEDI_CB_EOS;
+ if (comedi_buf_write_samples(s, &bits, 1)) {
if (cmd->stop_src == TRIG_COUNT &&
subpriv->stop_count > 0) {
subpriv->stop_count--;
@@ -221,8 +220,6 @@ static irqreturn_t apci2032_interrupt(int irq, void *d)
s->async->events |= COMEDI_CB_EOA;
}
}
- } else {
- s->async->events |= COMEDI_CB_OVERFLOW;
}
}
@@ -299,7 +296,7 @@ static int apci2032_auto_attach(struct comedi_device *dev,
return -ENOMEM;
spin_lock_init(&subpriv->spinlock);
s->private = subpriv;
- s->subdev_flags = SDF_READABLE | SDF_CMD_READ;
+ s->subdev_flags = SDF_READABLE | SDF_CMD_READ | SDF_PACKED;
s->len_chanlist = 2;
s->do_cmdtest = apci2032_int_cmdtest;
s->do_cmd = apci2032_int_cmd;
OpenPOWER on IntegriCloud