linux/drivers/staging/comedi
Ian Abbott 4efc4bbdc1 staging: comedi: work without HAS_DMA
The core "comedi" module and the "mite" helper module for NI PCI devices
both have calls to `dma_alloc_coherent()` and `dma_free_coherent()`.
Those functions are only available if `CONFIG_HAS_DMA` is defined.

Apart from the "mite" module, the functions are only called for comedi
drivers that set `s->async_dma_dir` (where `s` is a pointer to a `struct
comedi_subdevice`) to anything other than `DMA_NONE`.

Change local helper functions `__comedi_buf_alloc()` and
`__comedi_buf_free()` to only call `dma_alloc_coherent()` and
`dma_free_coherent()` if `CONFIG_HAS_DMA` is defined.

Change the "Kconfig" to make the following configuration options depend
on `HAS_DMA`:

`COMEDI_MITE` - builds the "mite" module.
`COMEDI_NI_6527` - selects `COMEDI_MITE`.
`COMEDI_NI_65XX` - selects `COMEDI_MITE`.
`COMEDI_NI_670X` - selects `COMEDI_MITE`.
`COMEDI_NI_LABPC_PCI` - selects `COMEDI_MITE`.
`COMEDI_NI_PCIDIO` - selects `COMEDI_MITE`.
`COMEDI_NI_TIOCMD` - selects `COMEDI_MITE`.
`COMEDI_NI_660X` - selects `COMEDI_NI_TIOCMD`,
                   sets `s->async_dma_dir`.
`COMEDI_NI_PCIMIO` - selects `COMEDI_NI_TIOCMD`,
                     sets `s->async_dma_dir`.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 17:38:46 -04:00
..
drivers staging: comedi: ni_labpc: fix build when VIRT_TO_BUS is not defined 2013-05-13 17:36:28 -04:00
kcomedilib staging: comedi: use EXPORT_SYMBOL_GPL() for all exported symbols 2013-04-12 15:09:59 -07:00
comedi_buf.c staging: comedi: work without HAS_DMA 2013-05-13 17:38:46 -04:00
comedi_compat32.c staging: comedi: Makefile: conditionally compile multi-file core module 2013-01-07 14:51:11 -08:00
comedi_compat32.h staging: comedi: shrink comedi_compat32.h 2012-06-20 12:57:43 -07:00
comedi_fops.c staging: comedi: allow buffer resize if previous resize failed 2013-05-13 17:37:04 -04:00
comedi_internal.h staging: comedi: change comedi_alloc_board_minor() to return pointer 2013-04-05 14:33:17 -07:00
comedi_pci.c staging: comedi: comedi_pci: dev->board_name is always valid 2013-04-08 11:39:19 -07:00
comedi_pcmcia.c staging: comedi: comedi_pcmcia: allow drivers to use a custom conf_check() 2013-02-05 18:16:19 -08:00
comedi_usb.c staging: comedi: comedi_usb: allow comedi usb drivers to pass a 'context' 2013-02-05 18:07:11 -08:00
comedi.h staging: comedi: deprecate loading firmware with comedi_config 2013-01-17 16:51:46 -08:00
comedidev.h staging: comedi: drivers: introduce comedi_legacy_detach() 2013-04-19 11:19:52 -07:00
comedilib.h
drivers.c staging: comedi: drivers: free_irq() in comedi_legacy_detach() 2013-04-19 11:19:54 -07:00
Kconfig staging: comedi: work without HAS_DMA 2013-05-13 17:38:46 -04:00
Makefile staging: comedi: conditionally build in PCMCIA driver support 2013-01-31 10:38:10 +01:00
proc.c staging: single_open() leaks 2013-05-05 00:15:43 -04:00
range.c staging: comedi: use EXPORT_SYMBOL_GPL() for all exported symbols 2013-04-12 15:09:59 -07:00
TODO