diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-10-31 09:49:31 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-03 16:31:24 -0800 |
commit | f8736ca466e2014d6e8bad478fcc5e5cb0105af0 (patch) | |
tree | efb86b1332d953979f285fddf283be17cf64a3e5 /drivers/staging/comedi/drivers/rtd520.c | |
parent | c1b617e017f858505ce639a8dee4d096fbcb7b6b (diff) |
staging: comedi: drivers: move comedi_async 'cur_chan' tracking into the core
The commedi_async 'cur_chan' member is used to track the current position
in the chanlist for a scan. Currently only a couple comedi drivers use
this member.
For aeshtetics, move the 'cur_chan' tracking into the core for non-SDF_PACKED
subdevices. The 'cur_chan' will be updated after reading or writing samples
to the async buffer by comedi_inc_scan_progress(). All non-SDF_PACKED subdevices
will then automatiaclly track the 'cur_chan'.
Some of the drivers use the 'cur_chan' to detect the end of scan event when
counting scans. The COMEDI_CB_EOS event is automatically added by the core
when the end of scan is detected. The drivers just need to check if the
'cur_chan' is 0 to count the number of scans completed.
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/rtd520.c')
-rw-r--r-- | drivers/staging/comedi/drivers/rtd520.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index 19596756864d..fb71fd60bc4e 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -628,9 +628,6 @@ static int ai_read_n(struct comedi_device *dev, struct comedi_subdevice *s, if (!comedi_buf_write_samples(s, &d, 1)) return -1; - async->cur_chan++; - async->cur_chan %= cmd->chanlist_len; - if (devpriv->ai_count > 0) /* < 0, means read forever */ devpriv->ai_count--; } |