From: p.pisati@gmail.com (Paolo Pisati)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: tango: register pm ops only if running on tango hw
Date: Wed, 22 Aug 2018 16:55:32 +0200 [thread overview]
Message-ID: <1534949732-3824-1-git-send-email-p.pisati@gmail.com> (raw)
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
reply other threads:[~2018-08-22 14:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1534949732-3824-1-git-send-email-p.pisati@gmail.com \
--to=p.pisati@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).