]> git.karo-electronics.de Git - linux-beck.git/commit
staging: comedi: das16: fix DMA init during board attach
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 29 Jul 2013 20:48:38 +0000 (13:48 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Aug 2013 00:37:44 +0000 (17:37 -0700)
commitb0926a7afabe49021f4fbed9baac0419ad3aa56a
tree8736d070d531426ae000981cd1b21ec3b716182d
parent5589c7cc9f37e929754e0a14b85db7c23a28129f
staging: comedi: das16: fix DMA init during board attach

DMA support is optional in this driver. To enable it, the user
passes the desired DMA channel during the board attach. A timer
is then used by the driver to periodically get the analog input
data from the DMA.

Since the DMA support is optional, modify the init code so that
it only fails if the DMA channel is unavailable or the DMA buffers
can not be allocated. Don't fail just because the user passed an
invalid DMA channel (only DMA channels 1 and 3 are valid).

Remove the printk() noise about the DMA. Change the printk() when
the request_dma() fails into a dev_err().

Move the timer initialization so it's only setup if DMA is available.
It's not needed otherwise. Also, only hook up the subdevice command
support functions if DMA is available. This allows removing a couple
sanity checks in the command support.

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