ARM: pxa: remove incorrect __init annotation on pxa27x_set_pwrmode
authorArnd Bergmann <arnd@arndb.de>
Mon, 12 Oct 2015 13:46:08 +0000 (15:46 +0200)
committerRobert Jarzmik <robert.jarzmik@free.fr>
Fri, 16 Oct 2015 18:52:39 +0000 (20:52 +0200)
The z2 machine calls pxa27x_set_pwrmode() in order to power off
the machine, but this function gets discarded early at boot because
it is marked __init, as pointed out by kbuild:

WARNING: vmlinux.o(.text+0x145c4): Section mismatch in reference from the function z2_power_off() to the function .init.text:pxa27x_set_pwrmode()
The function z2_power_off() references
the function __init pxa27x_set_pwrmode().
This is often because z2_power_off lacks a __init
annotation or the annotation of pxa27x_set_pwrmode is wrong.

This removes the __init section modifier to fix rebooting and the
build error.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: ba4a90a6d86a ("ARM: pxa/z2: fix building error of pxa27x_cpu_suspend() no longer available")
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
arch/arm/mach-pxa/include/mach/pxa27x.h
arch/arm/mach-pxa/pxa27x.c

index 599b925a657c46c5679524006757350b910436a7..1a4291936c582baaef76cb9af46c94333a6467d2 100644 (file)
@@ -19,7 +19,7 @@
 #define ARB_CORE_PARK          (1<<24)    /* Be parked with core when idle */
 #define ARB_LOCK_FLAG          (1<<23)    /* Only Locking masters gain access to the bus */
 
-extern int __init pxa27x_set_pwrmode(unsigned int mode);
+extern int pxa27x_set_pwrmode(unsigned int mode);
 extern void pxa27x_cpu_pm_enter(suspend_state_t state);
 
 #endif /* __MACH_PXA27x_H */
index 221260d5d1092364792e3eb181eea74a67462bc7..ffc4240285577919598820db167ec57c202fa2dd 100644 (file)
@@ -84,7 +84,7 @@ EXPORT_SYMBOL_GPL(pxa27x_configure_ac97reset);
  */
 static unsigned int pwrmode = PWRMODE_SLEEP;
 
-int __init pxa27x_set_pwrmode(unsigned int mode)
+int pxa27x_set_pwrmode(unsigned int mode)
 {
        switch (mode) {
        case PWRMODE_SLEEP: