summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/pcmuio.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2014-11-05 10:21:02 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-05 14:59:47 -0800
commitb03130b649840f5a25941a7e8ae78dea6d750c85 (patch)
tree4f858bee5705afb336ce6548cc6e070048cffb73 /drivers/staging/comedi/drivers/pcmuio.c
parent09959d658ce9049579561c7cb6acedaae74f5222 (diff)
staging: comedi: pcmuio: use comedi_async 'scans_done' to detect EOA
Remove the private data member 'stop_count' and use the comedi_async 'scans_done' member to detect the end-of-acquisition. 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>
Diffstat (limited to 'drivers/staging/comedi/drivers/pcmuio.c')
-rw-r--r--drivers/staging/comedi/drivers/pcmuio.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c
index 18c2ac28e34a..0f5483b6147f 100644
--- a/drivers/staging/comedi/drivers/pcmuio.c
+++ b/drivers/staging/comedi/drivers/pcmuio.c
@@ -130,7 +130,6 @@ struct pcmuio_asic {
spinlock_t pagelock; /* protects the page registers */
spinlock_t spinlock; /* protects member variables */
unsigned int enabled_mask;
- unsigned int stop_count;
unsigned int active:1;
};
@@ -338,14 +337,9 @@ static void pcmuio_handle_intr_subdev(struct comedi_device *dev,
comedi_buf_write_samples(s, &val, 1);
- /* Check for end of acquisition. */
- if (cmd->stop_src == TRIG_COUNT) {
- if (chip->stop_count > 0) {
- chip->stop_count--;
- if (chip->stop_count == 0)
- s->async->events |= COMEDI_CB_EOA;
- }
- }
+ if (cmd->stop_src == TRIG_COUNT &&
+ s->async->scans_done >= cmd->stop_arg)
+ s->async->events |= COMEDI_CB_EOA;
done:
spin_unlock_irqrestore(&chip->spinlock, flags);
@@ -474,8 +468,6 @@ static int pcmuio_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
spin_lock_irqsave(&chip->spinlock, flags);
chip->active = 1;
- chip->stop_count = cmd->stop_arg;
-
/* Set up start of acquisition. */
if (cmd->start_src == TRIG_INT)
s->async->inttrig = pcmuio_inttrig_start_intr;