linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: tango: register pm ops only if running on tango hw
@ 2018-08-22 14:55 Paolo Pisati
  0 siblings, 0 replies; only message in thread
From: Paolo Pisati @ 2018-08-22 14:55 UTC (permalink / raw)
  To: Russell King, Marc Gonzalez, Mans Rullgard; +Cc: linux-arm-kernel, linux-kernel

In a multiplatform kernel, avoid invoking hardware specific pm ops,
when running on a different SOC.

Signed-off-by: Paolo Pisati <p.pisati@gmail.com>
---
 arch/arm/mach-tango/pm.c    | 5 +----
 arch/arm/mach-tango/setup.c | 7 +++++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-tango/pm.c b/arch/arm/mach-tango/pm.c
index 028e50c..ea8fe20 100644
--- a/arch/arm/mach-tango/pm.c
+++ b/arch/arm/mach-tango/pm.c
@@ -24,10 +24,7 @@ static const struct platform_suspend_ops tango_pm_ops = {
 	.valid = suspend_valid_only_mem,
 };
 
-static int __init tango_pm_init(void)
+void __init tango_pm_init(void)
 {
 	suspend_set_ops(&tango_pm_ops);
-	return 0;
 }
-
-late_initcall(tango_pm_init);
diff --git a/arch/arm/mach-tango/setup.c b/arch/arm/mach-tango/setup.c
index 677dd7b..56a1c0c 100644
--- a/arch/arm/mach-tango/setup.c
+++ b/arch/arm/mach-tango/setup.c
@@ -11,8 +11,15 @@ static void tango_l2c_write(unsigned long val, unsigned int reg)
 
 static const char *const tango_dt_compat[] = { "sigma,tango4", NULL };
 
+#ifdef CONFIG_PM_SLEEP
+extern void tango_pm_init(void);
+#else
+static inline void tango_pm_init(void) {}
+#endif
+
 DT_MACHINE_START(TANGO_DT, "Sigma Tango DT")
 	.dt_compat	= tango_dt_compat,
+	.init_machine	= tango_pm_init,
 	.l2c_aux_mask	= ~0,
 	.l2c_write_sec	= tango_l2c_write,
 MACHINE_END
-- 
2.7.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-22 14:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-22 14:55 [PATCH] ARM: tango: register pm ops only if running on tango hw Paolo Pisati

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).