linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: pxa: z2: Fix section mismatch
@ 2015-10-05  8:37 Thierry Reding
  2015-10-05 19:50 ` Robert Jarzmik
  0 siblings, 1 reply; 2+ messages in thread
From: Thierry Reding @ 2015-10-05  8:37 UTC (permalink / raw)
  To: linux-arm-kernel

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 <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
---
 arch/arm/mach-pxa/z2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index e1a121b36cfa..36caac726ea7 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -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")
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] ARM: pxa: z2: Fix section mismatch
  2015-10-05  8:37 [PATCH] ARM: pxa: z2: Fix section mismatch Thierry Reding
@ 2015-10-05 19:50 ` Robert Jarzmik
  0 siblings, 0 replies; 2+ messages in thread
From: Robert Jarzmik @ 2015-10-05 19:50 UTC (permalink / raw)
  To: linux-arm-kernel

Thierry Reding <thierry.reding@gmail.com> writes:

> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-05 19:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-05  8:37 [PATCH] ARM: pxa: z2: Fix section mismatch Thierry Reding
2015-10-05 19:50 ` Robert Jarzmik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).