[PATCH v2] staging: comedi: ni_labpc: change VIRT_TO_BUS dependency

Ian Abbott abbotti at mev.co.uk
Fri Jun 28 12:40:29 UTC 2013


On 2013-06-27 17:50, Ian Abbott wrote:
> On 2013-06-27 17:08, Ian Abbott wrote:
>> The "ni_labpc" module acts as a low-level comedi driver for various
>> National Instruments Lab-PC ISA cards if `CONFIG_NI_LABPC_ISA` is
>> enabled, and also as a common module depended on by the "ni_labpc_cs"
>> and "ni_labpc_pci" modules.  For ISA cards, it optionally supports the
>> use of an ISA DMA channel if `CONFIG_ISA_DMA_API` is enabled, using
>> conditionally compiled code.  This conditionally compiled code also
>> relies on `virt_to_bus()`, which only exists if `CONFIG_VIRT_TO_BUS` is
>> enabled.  Therefore, support for ISA DMA should only be compiled in if
>> both `CONFIG_ISA_DMA_API` and `CONFIG_VIRT_TO_BUS` are defined.
>>
>> The `CONFIG_NI_LABPC_ISA` option currently depends on `VIRT_TO_BUS` at
>> configure time and checks `CONFIG_ISA_DMA_API` at compile time.  It
>> seems better to check both options at compile time.
>>
>> Conditionally define a new macro `NI_LABPC_ISA_DMA` iff both
>> `CONFIG_ISA_DMA_API` and `CONFIG_VIRT_TO_BUS` are defined, and change
>> the conditional compilation tests to use the new macro instead of
>> `CONFIG_ISA_DMA_API`.
>>
>> Also, in the "Kconfig", remove the `VIRT_TO_BUS` dependency from the
>> `COMEDI_NI_LABPC_ISA` option since the dependency is now checked at
>> compile time.
>
> On second thoughts, perhaps I should create a new module and header file
> and a new conditionally selected config option to handle the ISA DMA
> support in this module, as that would remove a bunch of #ifdefs (or at
> least hide them in the header file).

Might as well dump this patch now.  I've already split the ISA DMA 
support out into a separate module locally.  I just need to split my 
patch up for submission.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti at mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-


More information about the devel mailing list