Skip to content

Commit d0f9f16

Browse files
mwgonzalezarndb
authored andcommitted
ARM: tango: Improve ARCH_MULTIPLATFORM compatibility
Calling platform-specific code unconditionally blows up when running an ARCH_MULTIPLATFORM kernel on a different platform. Don't do it. Reported-by: Paolo Pisati <p.pisati@gmail.com> Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr> Acked-by: Pavel Machek <pavel@ucw.cz> Cc: stable@vger.kernel.org # v4.8+ Fixes: a30eceb ("ARM: tango: add Suspend-to-RAM support") Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent a17bab2 commit d0f9f16

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

arch/arm/mach-tango/pm.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <linux/suspend.h>
44
#include <asm/suspend.h>
55
#include "smc.h"
6+
#include "pm.h"
67

78
static int tango_pm_powerdown(unsigned long arg)
89
{
@@ -24,10 +25,7 @@ static const struct platform_suspend_ops tango_pm_ops = {
2425
.valid = suspend_valid_only_mem,
2526
};
2627

27-
static int __init tango_pm_init(void)
28+
void __init tango_pm_init(void)
2829
{
2930
suspend_set_ops(&tango_pm_ops);
30-
return 0;
3131
}
32-
33-
late_initcall(tango_pm_init);

arch/arm/mach-tango/pm.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
3+
#ifdef CONFIG_SUSPEND
4+
void __init tango_pm_init(void);
5+
#else
6+
#define tango_pm_init NULL
7+
#endif

arch/arm/mach-tango/setup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <asm/mach/arch.h>
33
#include <asm/hardware/cache-l2x0.h>
44
#include "smc.h"
5+
#include "pm.h"
56

67
static void tango_l2c_write(unsigned long val, unsigned int reg)
78
{
@@ -15,4 +16,5 @@ DT_MACHINE_START(TANGO_DT, "Sigma Tango DT")
1516
.dt_compat = tango_dt_compat,
1617
.l2c_aux_mask = ~0,
1718
.l2c_write_sec = tango_l2c_write,
19+
.init_late = tango_pm_init,
1820
MACHINE_END

0 commit comments

Comments
 (0)