staging: comedi: pcl818: fix (*cancel) when cmd->stop_src == TRIG_NONE

When using DMA, the async command (*cancel) operation is delayed until the
current DMA transfer is complete. When the DMA transfer finishes the interrupt
routine detects this and calls the (*cancel) again which should then cancel the
async command.

The current logic does not work when cmd->stop_src == TRIG_NONE. In this case
the (*cancel) function keeps delaying the cancel. The actual DMA does stop
because the DMA handler is not called to setup the next transfer but the
(*cancel) code is never executed.

Rename the 'irq_was_now_closed' flag in the private data to 'ai_cmd_canceled'
to clarify what it is.

Only set the flag in the (*cancel) when a DMA transfer is running and the
async command has not already been canceled. The interrupt routine then does
not need all the extra checks.

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>
1 file changed