Skip to contentSkip to conversation

: sparc64: Don't invoke power_init() from

PATCH New David Miller 1 participant 1 message Aug 30, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 : sparc64: Don't invoke power_init() from

sparc64: Don't invoke power_init() from pcibios_init().

That's just silly, use device_initcall() instead.

---
 arch/sparc64/kernel/pci.c   |    4 ----
 arch/sparc64/kernel/power.c |   16 +++++-----------
 2 files changed, 5 insertions(+), 15 deletions(-)
arch/sparc64/kernel/pci.c +0 -4
index 2187786..83c50a6 100644
@@ -799,8 +799,6 @@ static void __init pci_scan_each_controller_bus(void)
 		pbm->scan_bus(pbm);
 }
 
-extern void power_init(void);
-
 static int __init pcibios_init(void)
 {
 	pci_controller_probe();
@@ -809,8 +807,6 @@ static int __init pcibios_init(void)
 
 	pci_scan_each_controller_bus();
 
-	power_init();
-
 	return 0;
 }
 
arch/sparc64/kernel/power.c +5 -11
index 3bb987a..7536255 100644
@@ -1,29 +1,22 @@
 /* power.c: Power management driver.
  *
- * Copyright (C) 1999, 2007 David S. Miller ([email protected])
+ * Copyright (C) 1999, 2007, 2008 David S. Miller ([email protected])
  */
 
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/sched.h>
-#include <linux/signal.h>
-#include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/pm.h>
-#include <linux/syscalls.h>
 #include <linux/reboot.h>
 #include <linux/of_device.h>
 
-#include <asm/system.h>
 #include <asm/auxio.h>
 #include <asm/prom.h>
 #include <asm/io.h>
 #include <asm/sstate.h>
 #include <asm/reboot.h>
 
-#include <linux/unistd.h>
-
 /*
  * sysctl - toggle power-off restriction for serial console 
  * systems in machine_power_off()
@@ -111,8 +104,9 @@ static struct of_platform_driver power_driver = {
 	},
 };
 
-void __init power_init(void)
+static int __init power_init(void)
 {
-	of_register_driver(&power_driver, &of_platform_bus_type);
-	return;
+	return of_register_driver(&power_driver, &of_platform_bus_type);
 }
+
+device_initcall(power_init);
Signature · 1 line
1.5.6.5.GIT