staging: comedi: ni_labpc_isadma: move dma programming out of labpc_drain_dma()
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Tue, 13 Jan 2015 17:16:41 +0000 (10:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Jan 2015 22:31:31 +0000 (14:31 -0800)
commitf2c6bbe8e02d589a02282c2a260f912ab4f12376
treed5529a02090260db6352a793a25107fc0a1b4986
parent72ba5c1612f5ea7f907290903e8fc24ed94aec13
staging: comedi: ni_labpc_isadma: move dma programming out of labpc_drain_dma()

The external caller of labpc_drain_dma() does not enable the DMA transfer. Only
the call from handle_isa_dma() results in the programmed DMA operation getting
enabled.

For aesthetics, move the dma programming to handle_isa_dma(). Make sure the
DMA operation would actually do something (dma->size != 0) before programming
it to avoid enabling the DMA at the end of a stop_src == TRIG_COUNT command.

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/ni_labpc_isadma.c