On 2013-01-29 23:18, H Hartley Sweeten wrote:
Separate the comedi_pci_* functions out of drivers.c into a new source file, comedi_pci.c. This allows conditionally building support for comedi PCI drivers into the comedi core. Fix the Kconfig and Makefile appropriately. Group all the comedi_pci_* prototypes and related defines into one place in comedidev.h. Protect these prototypes with an #ifdef so that building a comedi pci driver without PCI support will cause a build error. This will normally not happen as long as the comedi PCI driver is placed in the proper group in the Kconfig.
I'm pretty certain this will cause compilation warnings for some mixed ISA/PCI drivers unless dummy replacements for comedi_pci_enable() and comedi_pci_disable() are provided. For example, disabling CONFIG_COMEDI_PCI, but enabling CONFIG_COMEDI_AMPLC_DIO200 will get result in some compiler warning in dio200_auto_attach(). If CONFIG_COMEDI_PCI is disabled, this never actually gets called (since the PCI driver never gets registered), but is linked to from amplc_dio200_driver.auto_attach. In this case, it compiles down to a dummy function returning -EINVAL, and the part of the function that calls comedi_pci_enable() will be optimized out, but the compiler will still issue a warning about the call to comedi_pci_enable() with no prototype. Similarly, the call to comedi_pci_disable() in dio200_detach() is optimized out but the compiler will still complain.
If it *is* just a warning, the dummy inline versions of comedi_pci_enable() and comedi_pci_disable() can be added in a separate patch.
I'd give it a quick test, but I'm currently struggling to get your first patch (and probably some of the later ones) to apply to (a clone of) Greg's staging-next branch for some reason!
-- -=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@xxxxxxxxx> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel