Skip to contentSkip to conversation

ARM: pxa: z2: Fix section mismatch

PATCH New Thierry Reding 2 participants 2 messages Oct 5, 2015

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

PATCH 1/1 ARM: pxa: z2: Fix section mismatch

The z2_power_off() function calls pxa27x_set_pwrmode(), which is marked __init. z2_power_off() is set up as the power off handler, so will need to stick around after __init data is discarded. Fix this by doing what everyone else does and set the power mode from the board initialization code instead.

Cc Daniel Mack <[email protected]>
Cc Haojian Zhuang <[email protected]>
Cc Robert Jarzmik <[email protected]>
---
 arch/arm/mach-pxa/z2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-pxa/z2.c +3 -3
index e1a121b36cfa..36caac726ea7 100644
@@ -690,11 +690,8 @@ static void z2_power_off(void)
 	 */
 	PSPR = 0x0;
 	local_irq_disable();
-	pxa27x_set_pwrmode(PWRMODE_DEEPSLEEP);
 	pxa27x_cpu_pm_enter(PM_SUSPEND_MEM);
 }
-#else
-#define z2_power_off   NULL
 #endif
 
 /******************************************************************************
@@ -719,7 +716,10 @@ static void __init z2_init(void)
 	z2_keys_init();
 	z2_pmic_init();
 
+#ifdef CONFIG_PM
+	pxa27x_set_pwrmode(PWRMODE_DEEPSLEEP);
 	pm_power_off = z2_power_off;
+#endif
 }
 
 MACHINE_START(ZIPIT2, "Zipit Z2")
Signature · 1 line
2.5.0
maintainer Applied
#1 lore raw

PATCH 1/1 ARM: pxa: z2: Fix section mismatch

Quoted 5 lines · Thierry Reding

The z2_power_off() function calls pxa27x_set_pwrmode(), which is marked __init. z2_power_off() is set up as the power off handler, so will need to stick around after __init data is discarded. Fix this by doing what everyone else does and set the power mode from the board initialization code instead.

Applied to pxa/fixes, thanks.

Cheers.

--
Robert