]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: comedi: split out USB support into new module
authorIan Abbott <abbotti@mev.co.uk>
Fri, 31 Oct 2014 17:47:38 +0000 (17:47 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Nov 2014 17:24:33 +0000 (09:24 -0800)
Setting the `CONFIG_COMEDI_USB_DRIVERS` kernel configuration option
makes the main "comedi" module depend on the "usbcore" module.  But
perhaps the machine has no USB controllers (or they have been disabled),
in which case the "usbcore" module may have been pulled in
unnecessarily.  Only a few low-level Comedi drivers require USB support.
The Comedi USB support functions are all in "comedi_usb.c".  Turn it
into a separate module so we don't have to pull in the "usbcore" and
"usb_common" modules unnecessarily.

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>
drivers/staging/comedi/Kconfig
drivers/staging/comedi/Makefile
drivers/staging/comedi/comedi_usb.c

index 862b18fa2de4d2d5d4a06b897276e9baf2de555d..9e22ea1f8c545d1068887778db1cb94b217501e6 100644 (file)
@@ -1155,11 +1155,14 @@ config COMEDI_QUATECH_DAQP_CS
 endif # COMEDI_PCMCIA_DRIVERS
 
 menuconfig COMEDI_USB_DRIVERS
-       bool "Comedi USB drivers"
+       tristate "Comedi USB drivers"
        depends on USB
        ---help---
          Enable support for comedi USB drivers.
 
+         To compile this support as a module, choose M here: the module will
+         be called comedi_usb.
+
 if COMEDI_USB_DRIVERS
 
 config COMEDI_DT9812
index cfb121a5297858f79436b6c117d9c5619ae63bb6..e28eaeb598bebab7e77b90d1a746ffb27692f3c6 100644 (file)
@@ -3,11 +3,11 @@ ccflags-$(CONFIG_COMEDI_DEBUG)                := -DDEBUG
 comedi-y                               := comedi_fops.o range.o drivers.o \
                                           comedi_buf.o
 comedi-$(CONFIG_COMEDI_PCI_DRIVERS)    += comedi_pci.o
-comedi-$(CONFIG_COMEDI_USB_DRIVERS)    += comedi_usb.o
 comedi-$(CONFIG_PROC_FS)               += proc.o
 comedi-$(CONFIG_COMPAT)                        += comedi_compat32.o
 
 obj-$(CONFIG_COMEDI_PCMCIA_DRIVERS)    += comedi_pcmcia.o
+obj-$(CONFIG_COMEDI_USB_DRIVERS)       += comedi_usb.o
 
 obj-$(CONFIG_COMEDI)                   += comedi.o
 
index 13f18bef60916ab07c5145269373ecf550aacc89..0b862a64c0493987bce20cf4d168d95aa6b46141 100644 (file)
@@ -16,6 +16,7 @@
  * GNU General Public License for more details.
  */
 
+#include <linux/module.h>
 #include <linux/usb.h>
 
 #include "comedidev.h"
@@ -114,3 +115,18 @@ void comedi_usb_driver_unregister(struct comedi_driver *comedi_driver,
        comedi_driver_unregister(comedi_driver);
 }
 EXPORT_SYMBOL_GPL(comedi_usb_driver_unregister);
+
+static int __init comedi_usb_init(void)
+{
+       return 0;
+}
+module_init(comedi_usb_init);
+
+static void __exit comedi_usb_exit(void)
+{
+}
+module_exit(comedi_usb_exit);
+
+MODULE_AUTHOR("http://www.comedi.org");
+MODULE_DESCRIPTION("Comedi USB interface module");
+MODULE_LICENSE("GPL");