]> git.karo-electronics.de Git - linux-beck.git/commitdiff
PCI: hotplug: Make core explicitly non-modular
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Wed, 24 Aug 2016 20:57:51 +0000 (16:57 -0400)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 24 Aug 2016 22:20:14 +0000 (17:20 -0500)
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>
drivers/pci/hotplug/cpci_hotplug.h
drivers/pci/hotplug/cpci_hotplug_core.c
drivers/pci/hotplug/pci_hotplug_core.c

index 555bcde3b19677e4ad90ddb0c7af11af68da9829..60e66e027ebc53ca5ff7434da7cc21896cd3df77 100644 (file)
@@ -101,10 +101,8 @@ int cpci_unconfigure_slot(struct slot *slot);
 
 #ifdef CONFIG_HOTPLUG_PCI_CPCI
 int cpci_hotplug_init(int debug);
-void cpci_hotplug_exit(void);
 #else
 static inline int cpci_hotplug_init(int debug) { return 0; }
-static inline void cpci_hotplug_exit(void) { }
 #endif
 
 #endif /* _CPCI_HOTPLUG_H */
index 7d3866c473121c1447fe225d27e2264aa902bb1a..7ec8a8f72c698ae0862b3c46052953e0bc26df4b 100644 (file)
@@ -719,13 +719,3 @@ cpci_hotplug_init(int debug)
        cpci_debug = debug;
        return 0;
 }
-
-void __exit
-cpci_hotplug_exit(void)
-{
-       /*
-        * Clean everything up.
-        */
-       cpci_hp_stop();
-       cpci_hp_unregister_controller(controller);
-}
index 9acd1997c6fef6ec037fa3cf046ba4075ac1557d..fea0b8b33589365663422bf116afbfb359cfbd10 100644 (file)
@@ -25,7 +25,7 @@
  *
  */
 
-#include <linux/module.h>
+#include <linux/module.h>      /* try_module_get & module_put */
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
@@ -537,17 +537,11 @@ static int __init pci_hotplug_init(void)
        info(DRIVER_DESC " version: " DRIVER_VERSION "\n");
        return result;
 }
+device_initcall(pci_hotplug_init);
 
-static void __exit pci_hotplug_exit(void)
-{
-       cpci_hotplug_exit();
-}
-
-module_init(pci_hotplug_init);
-module_exit(pci_hotplug_exit);
-
-MODULE_AUTHOR(DRIVER_AUTHOR);
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
+/*
+ * not really modular, but the easiest way to keep compat with existing
+ * bootargs behaviour is to continue using module_param here.
+ */
 module_param(debug, bool, 0644);
 MODULE_PARM_DESC(debug, "Debugging mode enabled or not");