diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2013-01-30 22:22:44 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-31 09:38:10 (GMT) |
commit | 309231d7a610554b02084ff7b465e43ef383a3bc (patch) | |
tree | b878efbc3fd1cd16a6ecea26e1b8d4867ee2ef6f /drivers/staging/comedi/comedidev.h | |
parent | 33782dd5edf8db3cdb7c81a3523bf743dd0209b7 (diff) | |
download | linux-fsl-qoriq-309231d7a610554b02084ff7b465e43ef383a3bc.tar.xz |
staging: comedi: conditionally build in PCMCIA driver support
Separate the comedi_pcmcia_* functions out of drivers.c into a new
source file, comedi_pcmcia.c. This allows conditionally building
support for comedi pcmcia drivers into the comedi core without the
need for the #if'defery. Fix the Kconfig and Makefile appropriately.
Group all the comedi_pcmcia_* prototypes into one place in comedidev.h.
Protect these prototypes with an #ifdef so that building a comedi
pcmcia driver without PCMCIA support will cause a build error. This
will normally not happen as long as the comedi pcmcia driver is placed
in the proper group in the Kconfig.
Remove the #include <pcmcia/*.h> from drivers.c. These includes are only
needed by the comedi pcmcia driver support code and the pcmcia drivers.
The include should occur in those files.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/comedidev.h')
-rw-r--r-- | drivers/staging/comedi/comedidev.h | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h index 666cade..329b1d7 100644 --- a/drivers/staging/comedi/comedidev.h +++ b/drivers/staging/comedi/comedidev.h @@ -278,27 +278,6 @@ int comedi_driver_unregister(struct comedi_driver *); module_driver(__comedi_driver, comedi_driver_register, \ comedi_driver_unregister) -struct pcmcia_driver; - -int comedi_pcmcia_driver_register(struct comedi_driver *, - struct pcmcia_driver *); -void comedi_pcmcia_driver_unregister(struct comedi_driver *, - struct pcmcia_driver *); - -/** - * module_comedi_pcmcia_driver() - Helper macro for registering a comedi PCMCIA driver - * @__comedi_driver: comedi_driver struct - * @__pcmcia_driver: pcmcia_driver struct - * - * Helper macro for comedi PCMCIA drivers which do not do anything special - * in module init/exit. This eliminates a lot of boilerplate. Each - * module may only use this macro once, and calling it replaces - * module_init() and module_exit() - */ -#define module_comedi_pcmcia_driver(__comedi_driver, __pcmcia_driver) \ - module_driver(__comedi_driver, comedi_pcmcia_driver_register, \ - comedi_pcmcia_driver_unregister, &(__pcmcia_driver)) - void init_polling(void); void cleanup_polling(void); void start_polling(struct comedi_device *); @@ -481,6 +460,33 @@ static inline void comedi_pci_disable(struct pci_dev *dev) #endif /* CONFIG_COMEDI_PCI_DRIVERS */ +#ifdef CONFIG_COMEDI_PCMCIA_DRIVERS + +/* comedi_pcmcia.c - comedi PCMCIA driver specific functions */ + +struct pcmcia_driver; + +int comedi_pcmcia_driver_register(struct comedi_driver *, + struct pcmcia_driver *); +void comedi_pcmcia_driver_unregister(struct comedi_driver *, + struct pcmcia_driver *); + +/** + * module_comedi_pcmcia_driver() - Helper macro for registering a comedi PCMCIA driver + * @__comedi_driver: comedi_driver struct + * @__pcmcia_driver: pcmcia_driver struct + * + * Helper macro for comedi PCMCIA drivers which do not do anything special + * in module init/exit. This eliminates a lot of boilerplate. Each + * module may only use this macro once, and calling it replaces + * module_init() and module_exit() + */ +#define module_comedi_pcmcia_driver(__comedi_driver, __pcmcia_driver) \ + module_driver(__comedi_driver, comedi_pcmcia_driver_register, \ + comedi_pcmcia_driver_unregister, &(__pcmcia_driver)) + +#endif /* CONFIG_COMEDI_PCMCIA_DRIVERS */ + #ifdef CONFIG_COMEDI_USB_DRIVERS /* comedi_usb.c - comedi USB driver specific functions */ |