aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/comedidev.h
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-01-30 15:22:44 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-31 10:38:10 +0100
commit309231d7a610554b02084ff7b465e43ef383a3bc (patch)
treeb878efbc3fd1cd16a6ecea26e1b8d4867ee2ef6f /drivers/staging/comedi/comedidev.h
parentstaging: comedi: conditionally build in PCI driver support (diff)
downloadlinux-dev-309231d7a610554b02084ff7b465e43ef383a3bc.tar.xz
linux-dev-309231d7a610554b02084ff7b465e43ef383a3bc.zip
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.h48
1 files changed, 27 insertions, 21 deletions
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index 666caded363b..329b1d7bc45e 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 */