staging: comedi: comedi_test: change end-of-acquisition test
authorIan Abbott <abbotti@mev.co.uk>
Fri, 4 Jan 2013 11:33:23 +0000 (11:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Jan 2013 22:37:12 +0000 (14:37 -0800)
commitea4f72b27985e21c846ffbff1a27871db4f8708e
tree737a67bc1b6d22780228d2a8704186a6d605a449
parent594dc67c239afd2f33b40c826bba887b38adf270
staging: comedi: comedi_test: change end-of-acquisition test

In the "comedi_test" module's acquisition timer function
`waveform_ai_interrupt()`, move the code for ending the acquisition
outside the scan loop.  Determine if the number of scans to be done is
sufficient to end the acquisition before entering the scan loop.  On
leaving the scan loop, set the `COMEDI_CB_EOA` event if the acquisition
is ending.  Only reschedule the timer if the acquisition is not ending.

Remove the somewhat useless `timer_running` flag from the private data.
This was intended to stop the timer function adding the timer back on
the timer queue periodically, but the flag setting wasn't synchronized
with the timer and we already use `del_timer_sync()` to synchronize
removal from the queue.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/comedi_test.c
This page took 0.047975 seconds and 5 git commands to generate.