diff options
author | Randy Dunlap <rdunlap@xenotime.net> | 2012-06-11 19:35:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-11 19:49:35 -0400 |
commit | 78b10615ad295393a7d66ea57218171c0a07c059 (patch) | |
tree | 5f5654b78d6af51d2d38baa498ad6652cf6fb74e | |
parent | afb6a6a01b51b6712485ea045e2b882061d250d9 (diff) |
staging/comedi: fix build for USB not enabled
Calls to optional subsystems cannot be made indiscriminately.
Enclose all of the usb helper functions inside
#if IS_ENABLED(CONFIG_USB)
to fix these build errors.
(The pci helper functions are OK since there are stubs in
linux/pci.h for the called functions when PCI is not enabled.
Possibly the same could be done for the called USB functions.)
ERROR: "usb_deregister" [drivers/staging/comedi/comedi.ko] undefined!
ERROR: "usb_register_driver" [drivers/staging/comedi/comedi.ko] undefined!
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/comedi/drivers.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c index 1c3d6386ea36..aeac1caba3f9 100644 --- a/drivers/staging/comedi/drivers.c +++ b/drivers/staging/comedi/drivers.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/pci.h> | 30 | #include <linux/pci.h> |
31 | #include <linux/usb.h> | 31 | #include <linux/usb.h> |
32 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
33 | #include <linux/kconfig.h> | ||
33 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
34 | #include <linux/sched.h> | 35 | #include <linux/sched.h> |
35 | #include <linux/fcntl.h> | 36 | #include <linux/fcntl.h> |
@@ -981,6 +982,8 @@ void comedi_pci_driver_unregister(struct comedi_driver *comedi_driver, | |||
981 | } | 982 | } |
982 | EXPORT_SYMBOL_GPL(comedi_pci_driver_unregister); | 983 | EXPORT_SYMBOL_GPL(comedi_pci_driver_unregister); |
983 | 984 | ||
985 | #if IS_ENABLED(CONFIG_USB) | ||
986 | |||
984 | static int comedi_old_usb_auto_config(struct usb_interface *intf, | 987 | static int comedi_old_usb_auto_config(struct usb_interface *intf, |
985 | struct comedi_driver *driver) | 988 | struct comedi_driver *driver) |
986 | { | 989 | { |
@@ -1043,3 +1046,5 @@ void comedi_usb_driver_unregister(struct comedi_driver *comedi_driver, | |||
1043 | comedi_driver_unregister(comedi_driver); | 1046 | comedi_driver_unregister(comedi_driver); |
1044 | } | 1047 | } |
1045 | EXPORT_SYMBOL_GPL(comedi_usb_driver_unregister); | 1048 | EXPORT_SYMBOL_GPL(comedi_usb_driver_unregister); |
1049 | |||
1050 | #endif | ||