diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2016-08-24 16:57:51 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-08-24 18:20:14 -0400 |
commit | 57b51b9adb4ca67d15c4f4b61268771da014c44a (patch) | |
tree | 5d9d4c522cb8742f27bc52c047ff9e6fd8e2f1ba | |
parent | ff187e777cce8033dac2cd54d010bb7978e84642 (diff) |
PCI: hotplug: Make core explicitly non-modular
This code is not being built as a module by anyone:
obj-$(CONFIG_HOTPLUG_PCI) += pci_hotplug.o
[...]
pci_hotplug-objs := pci_hotplug_core.o
drivers/pci/hotplug/Kconfig:menuconfig HOTPLUG_PCI
drivers/pci/hotplug/Kconfig: bool "Support for PCI Hotplug"
Remove uses of MODULE_DESCRIPTION(), MODULE_AUTHOR(), MODULE_LICENSE(),
etc., so that when reading the driver there is no doubt it is builtin-only.
The information is preserved in comments at the top of the file.
Remove orphaned exit function in cpci_hotplug_core.c.
Note that for non-modular code, module_init() translates to
device_initcall(). One could argue that we should use subsys_initcall()
here, but for now we stick with runtime equivalence.
We would delete module.h and just keep the moduleparam.h include (since the
file does use module_param), but there is a try_module_get and module_put
pairing that prevents us from doing that.
[bhelgaas: changelog]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: Scott Murray <scott@spiteful.org>
CC: Kristen Carlson Accardi <kristen@linux.intel.com>
-rw-r--r-- | drivers/pci/hotplug/cpci_hotplug.h | 2 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpci_hotplug_core.c | 10 | ||||
-rw-r--r-- | drivers/pci/hotplug/pci_hotplug_core.c | 18 |
3 files changed, 6 insertions, 24 deletions
diff --git a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h index 555bcde3b196..60e66e027ebc 100644 --- a/drivers/pci/hotplug/cpci_hotplug.h +++ b/drivers/pci/hotplug/cpci_hotplug.h | |||
@@ -101,10 +101,8 @@ int cpci_unconfigure_slot(struct slot *slot); | |||
101 | 101 | ||
102 | #ifdef CONFIG_HOTPLUG_PCI_CPCI | 102 | #ifdef CONFIG_HOTPLUG_PCI_CPCI |
103 | int cpci_hotplug_init(int debug); | 103 | int cpci_hotplug_init(int debug); |
104 | void cpci_hotplug_exit(void); | ||
105 | #else | 104 | #else |
106 | static inline int cpci_hotplug_init(int debug) { return 0; } | 105 | static inline int cpci_hotplug_init(int debug) { return 0; } |
107 | static inline void cpci_hotplug_exit(void) { } | ||
108 | #endif | 106 | #endif |
109 | 107 | ||
110 | #endif /* _CPCI_HOTPLUG_H */ | 108 | #endif /* _CPCI_HOTPLUG_H */ |
diff --git a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c index 7d3866c47312..7ec8a8f72c69 100644 --- a/drivers/pci/hotplug/cpci_hotplug_core.c +++ b/drivers/pci/hotplug/cpci_hotplug_core.c | |||
@@ -719,13 +719,3 @@ cpci_hotplug_init(int debug) | |||
719 | cpci_debug = debug; | 719 | cpci_debug = debug; |
720 | return 0; | 720 | return 0; |
721 | } | 721 | } |
722 | |||
723 | void __exit | ||
724 | cpci_hotplug_exit(void) | ||
725 | { | ||
726 | /* | ||
727 | * Clean everything up. | ||
728 | */ | ||
729 | cpci_hp_stop(); | ||
730 | cpci_hp_unregister_controller(controller); | ||
731 | } | ||
diff --git a/drivers/pci/hotplug/pci_hotplug_core.c b/drivers/pci/hotplug/pci_hotplug_core.c index 9acd1997c6fe..fea0b8b33589 100644 --- a/drivers/pci/hotplug/pci_hotplug_core.c +++ b/drivers/pci/hotplug/pci_hotplug_core.c | |||
@@ -25,7 +25,7 @@ | |||
25 | * | 25 | * |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <linux/module.h> | 28 | #include <linux/module.h> /* try_module_get & module_put */ |
29 | #include <linux/moduleparam.h> | 29 | #include <linux/moduleparam.h> |
30 | #include <linux/kernel.h> | 30 | #include <linux/kernel.h> |
31 | #include <linux/types.h> | 31 | #include <linux/types.h> |
@@ -537,17 +537,11 @@ static int __init pci_hotplug_init(void) | |||
537 | info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); | 537 | info(DRIVER_DESC " version: " DRIVER_VERSION "\n"); |
538 | return result; | 538 | return result; |
539 | } | 539 | } |
540 | device_initcall(pci_hotplug_init); | ||
540 | 541 | ||
541 | static void __exit pci_hotplug_exit(void) | 542 | /* |
542 | { | 543 | * not really modular, but the easiest way to keep compat with existing |
543 | cpci_hotplug_exit(); | 544 | * bootargs behaviour is to continue using module_param here. |
544 | } | 545 | */ |
545 | |||
546 | module_init(pci_hotplug_init); | ||
547 | module_exit(pci_hotplug_exit); | ||
548 | |||
549 | MODULE_AUTHOR(DRIVER_AUTHOR); | ||
550 | MODULE_DESCRIPTION(DRIVER_DESC); | ||
551 | MODULE_LICENSE("GPL"); | ||
552 | module_param(debug, bool, 0644); | 546 | module_param(debug, bool, 0644); |
553 | MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); | 547 | MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); |