diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-11-05 10:20:56 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-05 14:59:47 -0800 |
commit | 5f6da288e3cc03fb50d8eadfdb3d6ed0a8467df7 (patch) | |
tree | d3ca2e4a9a9308f5ab1d0db878833a38a983f99e | |
parent | 8712f901c9952bbad52e499fe350434294efbcff (diff) | |
download | lwn-5f6da288e3cc03fb50d8eadfdb3d6ed0a8467df7.tar.gz lwn-5f6da288e3cc03fb50d8eadfdb3d6ed0a8467df7.zip |
staging: comedi: pcl812: use comedi_async 'scans_done' to detect EOA
Remove the private data member 'ai_act_scan' 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/pcl812.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/staging/comedi/drivers/pcl812.c b/drivers/staging/comedi/drivers/pcl812.c index b13e9fb7a12e..c3499aa47dee 100644 --- a/drivers/staging/comedi/drivers/pcl812.c +++ b/drivers/staging/comedi/drivers/pcl812.c @@ -512,7 +512,6 @@ struct pcl812_private { unsigned int last_ai_chanspec; unsigned char mode_reg_int; /* there is stored INT number for some card */ unsigned int ai_poll_ptr; /* how many sampes transfer poll */ - unsigned int ai_act_scan; /* how many scans we finished */ unsigned int dmapages; unsigned int hwdmasize; unsigned long dmabuf[2]; /* PTR to DMA buf */ @@ -807,7 +806,6 @@ static int pcl812_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) devpriv->ai_dma = 0; } - devpriv->ai_act_scan = 0; devpriv->ai_poll_ptr = 0; /* don't we want wake up every scan? */ @@ -840,15 +838,10 @@ static int pcl812_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) static bool pcl812_ai_next_chan(struct comedi_device *dev, struct comedi_subdevice *s) { - struct pcl812_private *devpriv = dev->private; struct comedi_cmd *cmd = &s->async->cmd; - if (s->async->cur_chan == 0) - devpriv->ai_act_scan++; - if (cmd->stop_src == TRIG_COUNT && - devpriv->ai_act_scan >= cmd->stop_arg) { - /* all data sampled */ + s->async->scans_done >= cmd->stop_arg) { s->async->events |= COMEDI_CB_EOA; return false; } |