staging: comedi: pcl816: factor out the "next ai chan" code
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 4 Mar 2014 18:29:37 +0000 (11:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 01:06:12 +0000 (17:06 -0800)
commit0f8837bc80dda193535a47776c19e433f24b75de
treed8539108c6b2720bbb78b38b57fe0e759267ee99
parentdb702b7858abd08ecd99bec1544eb519801330aa
staging: comedi: pcl816: factor out the "next ai chan" code

Factor out the code that bumps the counters in the private data that keep
track of what channel is being samples next and when all the data has been
sampled.

Don't clear the events in the driver. The comedi core will clear the events
at the end of the comedi_event().

Make sure the COMEDI_CB_BLOCK event is set when advancing to the next
channel so that when the comedi_event() is finally called the core will
wake the async_queue to return the analog input data.

Also, make sure the COMEDI_CB_EOS event is set at the completion of each
scan.

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>
drivers/staging/comedi/drivers/pcl816.c