summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2014-11-05 18:20:54 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-05 23:59:46 +0100
commite268240387ffd868286d81848e38260c597e018e (patch)
tree482925a8659053da1bdef66a0bcc5cabe5f94eff
parentstaging: comedi: addi_apci_2032: use comedi_async 'scans_done' to detect EOA (diff)
downloadlinux-e268240387ffd868286d81848e38260c597e018e.tar.xz
linux-e268240387ffd868286d81848e38260c597e018e.zip
staging: comedi: amplc_dio200_common: use comedi_async 'scans_done' to detect EOA
Remove the private data member 'stopcount' 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>
-rw-r--r--drivers/staging/comedi/drivers/amplc_dio200_common.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/staging/comedi/drivers/amplc_dio200_common.c b/drivers/staging/comedi/drivers/amplc_dio200_common.c
index c306226790bf..26aad705aad3 100644
--- a/drivers/staging/comedi/drivers/amplc_dio200_common.c
+++ b/drivers/staging/comedi/drivers/amplc_dio200_common.c
@@ -120,7 +120,6 @@ struct dio200_subdev_intr {
unsigned int ofs;
unsigned int valid_isns;
unsigned int enabled_isns;
- unsigned int stopcount;
bool active:1;
};
@@ -256,7 +255,6 @@ static void dio200_read_scan_intr(struct comedi_device *dev,
struct comedi_subdevice *s,
unsigned int triggered)
{
- struct dio200_subdev_intr *subpriv = s->private;
struct comedi_cmd *cmd = &s->async->cmd;
unsigned short val;
unsigned int n, ch;
@@ -270,14 +268,9 @@ static void dio200_read_scan_intr(struct comedi_device *dev,
comedi_buf_write_samples(s, &val, 1);
- /* Check for end of acquisition. */
- if (cmd->stop_src == TRIG_COUNT) {
- if (subpriv->stopcount > 0) {
- subpriv->stopcount--;
- if (subpriv->stopcount == 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;
}
static int dio200_handle_read_intr(struct comedi_device *dev,
@@ -424,7 +417,6 @@ static int dio200_subdev_intr_cmd(struct comedi_device *dev,
spin_lock_irqsave(&subpriv->spinlock, flags);
subpriv->active = true;
- subpriv->stopcount = cmd->stop_arg;
if (cmd->start_src == TRIG_INT)
s->async->inttrig = dio200_inttrig_start_intr;