Commit d0f9f167 authored by Marc Gonzalez's avatar Marc Gonzalez Committed by Arnd Bergmann

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: default avatarPaolo Pisati <p.pisati@gmail.com>
Signed-off-by: default avatarMarc Gonzalez <marc.w.gonzalez@free.fr>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Cc: stable@vger.kernel.org # v4.8+
Fixes: a30eceb7 ("ARM: tango: add Suspend-to-RAM support")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent a17bab2d
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <linux/suspend.h> #include <linux/suspend.h>
#include <asm/suspend.h> #include <asm/suspend.h>
#include "smc.h" #include "smc.h"
#include "pm.h"
static int tango_pm_powerdown(unsigned long arg) static int tango_pm_powerdown(unsigned long arg)
{ {
...@@ -24,10 +25,7 @@ static const struct platform_suspend_ops tango_pm_ops = { ...@@ -24,10 +25,7 @@ static const struct platform_suspend_ops tango_pm_ops = {
.valid = suspend_valid_only_mem, .valid = suspend_valid_only_mem,
}; };
static int __init tango_pm_init(void) void __init tango_pm_init(void)
{ {
suspend_set_ops(&tango_pm_ops); suspend_set_ops(&tango_pm_ops);
return 0;
} }
late_initcall(tango_pm_init);
/* SPDX-License-Identifier: GPL-2.0 */
#ifdef CONFIG_SUSPEND
void __init tango_pm_init(void);
#else
#define tango_pm_init NULL
#endif
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <asm/mach/arch.h> #include <asm/mach/arch.h>
#include <asm/hardware/cache-l2x0.h> #include <asm/hardware/cache-l2x0.h>
#include "smc.h" #include "smc.h"
#include "pm.h"
static void tango_l2c_write(unsigned long val, unsigned int reg) static void tango_l2c_write(unsigned long val, unsigned int reg)
{ {
...@@ -15,4 +16,5 @@ DT_MACHINE_START(TANGO_DT, "Sigma Tango DT") ...@@ -15,4 +16,5 @@ DT_MACHINE_START(TANGO_DT, "Sigma Tango DT")
.dt_compat = tango_dt_compat, .dt_compat = tango_dt_compat,
.l2c_aux_mask = ~0, .l2c_aux_mask = ~0,
.l2c_write_sec = tango_l2c_write, .l2c_write_sec = tango_l2c_write,
.init_late = tango_pm_init,
MACHINE_END MACHINE_END
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment