Skip to contentSkip to conversation

proper prototype for drivers/base/init.c:driver_init()

PATCH In review Adrian Bunk 2 participants 3 messages Nov 25, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 proper prototype for drivers/base/init.c:driver_init()

This patch adds a prototype for driver_init() in include/linux/device.h.

It also removes a static function of the same name in drivers/acpi/ibm_acpi.c to ibm_acpi_driver_init() to fix the namespace collision.

---

 drivers/acpi/ibm_acpi.c |    4 ++--
 include/linux/device.h  |    2 ++
 init/main.c             |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)
include/linux/device.h renamed from include/linux/device.h.old +2 -0
@@ -432,6 +432,8 @@
 	return dev->is_registered;
 }
 
+void driver_init(void);
+
 /*
  * High level routines for use by the bus drivers
  */
init/main.c renamed from init/main.c.old +1 -1
@@ -52,6 +52,7 @@
 #include <linux/debug_locks.h>
 #include <linux/lockdep.h>
 #include <linux/pid_namespace.h>
+#include <linux/device.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
@@ -90,7 +91,6 @@
 extern void radix_tree_init(void);
 extern void free_initmem(void);
 extern void populate_rootfs(void);
-extern void driver_init(void);
 extern void prepare_namespace(void);
 #ifdef	CONFIG_ACPI
 extern void acpi_early_init(void);
drivers/acpi/ibm_acpi.c renamed from drivers/acpi/ibm_acpi.c.old +2 -2
@@ -355,7 +355,7 @@
 	return start;
 }
 
-static int driver_init(void)
+static int ibm_acpi_driver_init(void)
 {
 	printk(IBM_INFO "%s v%s\n", IBM_DESC, IBM_VERSION);
 	printk(IBM_INFO "%s\n", IBM_URL);
@@ -1634,7 +1634,7 @@
 static struct ibm_struct ibms[] = {
 	{
 	 .name = "driver",
-	 .init = driver_init,
+	 .init = ibm_acpi_driver_init,
 	 .read = driver_read,
 	 },
 	{
#1 lore raw
Quoted 3 lines · Adrian Bunk

It also removes a static function of the same name in drivers/acpi/ibm_acpi.c to ibm_acpi_driver_init() to fix the namespace collision.

I might as well fix the entire ibm-acpi driver so that it doesn't have any more issues like this in the future.

I will prepare a patch. I never liked namespace-pollution-prone symbols, anyway.

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
#2 lore raw
In reply to Adrian Bunk
Quoted 7 lines · Adrian Bunk

This patch adds a prototype for driver_init() in include/linux/device.h.

It also removes a static function of the same name in drivers/acpi/ibm_acpi.c to ibm_acpi_driver_init() to fix the namespace collision.

ACK for the proposed ibm-acpi changes (I can't speak for driver_init). A full namespace cleanup in ibm-acpi will touch pretty much every function in the ibm-acpi driver, so it will have to wait until a bunch of patches that I just submitted for acpi-test are either merged or rejected.

Signature · 4 lines
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh