Skip to contentSkip to conversation

ARM: highbank: call highbank_pm_init in .init_late hook

PATCH New Shawn Guo 2 participants 2 messages Sep 17, 2012

Subsystems (3)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

PATCH 1/1 ARM: highbank: call highbank_pm_init in .init_late hook

Being a module_init call, highbank_pm_init will cause problem with multi-platform build running on other platforms. Call it in the .init_late hook instead.

---
 arch/arm/mach-highbank/core.h     |    5 +++++
 arch/arm/mach-highbank/highbank.c |    6 ++++++
 arch/arm/mach-highbank/pm.c       |    4 +---
 3 files changed, 12 insertions(+), 3 deletions(-)
arch/arm/mach-highbank/core.h +5 -0
index 598ee78..c2e2c46 100644
@@ -10,5 +10,10 @@ static inline void highbank_lluart_map_io(void) {}
 
 extern void highbank_smc1(int fn, int arg);
 extern void highbank_cpu_die(unsigned int cpu);
+#ifdef CONFIG_PM
+extern void highbank_pm_init(void);
+#else
+static inline void highbank_pm_init(void) {}
+#endif
 
 extern struct smp_operations highbank_smp_ops;
arch/arm/mach-highbank/highbank.c +6 -0
index 709bd72..8b1c5ba 100644
@@ -156,6 +156,11 @@ static void __init highbank_init(void)
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
+static void __init highbank_init_late(void)
+{
+	highbank_pm_init();
+}
+
 static const char *highbank_match[] __initconst = {
 	"calxeda,highbank",
 	NULL,
@@ -168,6 +173,7 @@ DT_MACHINE_START(HIGHBANK, "Highbank")
 	.timer		= &highbank_timer,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= highbank_init,
+	.init_late	= highbank_init_late,
 	.dt_compat	= highbank_match,
 	.restart	= highbank_restart,
 MACHINE_END
arch/arm/mach-highbank/pm.c +1 -3
index 33b3beb..de866f2 100644
@@ -47,9 +47,7 @@ static const struct platform_suspend_ops highbank_pm_ops = {
 	.valid = suspend_valid_only_mem,
 };
 
-static int __init highbank_pm_init(void)
+void __init highbank_pm_init(void)
 {
 	suspend_set_ops(&highbank_pm_ops);
-	return 0;
 }
-module_init(highbank_pm_init);
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 ARM: highbank: call highbank_pm_init in .init_late hook

Quoted 3 lines · Shawn Guo

Being a module_init call, highbank_pm_init will cause problem with multi-platform build running on other platforms. Call it in the .init_late hook instead.

I don't think this needs to be init_late that I recall, so highbank_pm_init can just be called from highbank_init. I can update it.

I've scanned all the other platforms converted and it looks like I'm the only problem. :)

Rob

Quoted 63 lines
---
 arch/arm/mach-highbank/core.h     |    5 +++++
 arch/arm/mach-highbank/highbank.c |    6 ++++++
 arch/arm/mach-highbank/pm.c       |    4 +---
 3 files changed, 12 insertions(+), 3 deletions(-)
arch/arm/mach-highbank/core.h +5 -0
index 598ee78..c2e2c46 100644
@@ -10,5 +10,10 @@ static inline void highbank_lluart_map_io(void) {}
 
 extern void highbank_smc1(int fn, int arg);
 extern void highbank_cpu_die(unsigned int cpu);
+#ifdef CONFIG_PM
+extern void highbank_pm_init(void);
+#else
+static inline void highbank_pm_init(void) {}
+#endif
 
 extern struct smp_operations highbank_smp_ops;
arch/arm/mach-highbank/highbank.c +6 -0
index 709bd72..8b1c5ba 100644
@@ -156,6 +156,11 @@ static void __init highbank_init(void)
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 }
 
+static void __init highbank_init_late(void)
+{
+	highbank_pm_init();
+}
+
 static const char *highbank_match[] __initconst = {
 	"calxeda,highbank",
 	NULL,
@@ -168,6 +173,7 @@ DT_MACHINE_START(HIGHBANK, "Highbank")
 	.timer		= &highbank_timer,
 	.handle_irq	= gic_handle_irq,
 	.init_machine	= highbank_init,
+	.init_late	= highbank_init_late,
 	.dt_compat	= highbank_match,
 	.restart	= highbank_restart,
 MACHINE_END
arch/arm/mach-highbank/pm.c +1 -3
index 33b3beb..de866f2 100644
@@ -47,9 +47,7 @@ static const struct platform_suspend_ops highbank_pm_ops = {
 	.valid = suspend_valid_only_mem,
 };
 
-static int __init highbank_pm_init(void)
+void __init highbank_pm_init(void)
 {
 	suspend_set_ops(&highbank_pm_ops);
-	return 0;
 }
-module_init(highbank_pm_init);