From patchwork Mon Sep 17 02:50:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 1464841 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id A69413FD40 for ; Mon, 17 Sep 2012 02:53:32 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TDRPW-0002Lv-2k; Mon, 17 Sep 2012 02:50:10 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TDRPS-0002Lh-CF for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2012 02:50:07 +0000 Received: by pbbrq8 with SMTP id rq8so9122935pbb.36 for ; Sun, 16 Sep 2012 19:50:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=e1qjD9eeUV2wmRjnVJBZf1W/zCy6KV+sxawhcmFTs00=; b=RvyubVpH+ckISIROWopIwKzOfclLdJAaZ0E6w0mhwPbPu6MMYy9OEoZsOEfNcdVWvH 8WxYaPYVeraV2Sd30iTOijHA61AyEjq6MlU0m6EiHvOkQQ3sIVefd0Y0GswEmNfzi4wN 4U35/GVnz1RDVZDjOTSx5RXJpsS/HyApJBF+6fQ/6dSmihDgSamnwhBOuMNlkeXjuJKc kIeNcRbXA3h2EuAUq2o738u4D1UiTvnZthpRnZdgQs/JrmOHDFvtxAUHePwv1yJQuH3z n2tqm1Nmmuvb6HF2B3y/TJ/nbSHJDLtf0ZrMxSFH/tHRoka3t++D69g9iuC0RBoU6XzW E7/g== Received: by 10.66.86.201 with SMTP id r9mr17559844paz.16.1347850203284; Sun, 16 Sep 2012 19:50:03 -0700 (PDT) Received: from S2101-09.ap.freescale.net ([221.225.141.190]) by mx.google.com with ESMTPS id rz10sm6163037pbc.32.2012.09.16.19.50.00 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Sep 2012 19:50:02 -0700 (PDT) From: Shawn Guo To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: highbank: call highbank_pm_init in .init_late hook Date: Mon, 17 Sep 2012 10:50:16 +0800 Message-Id: <1347850216-1979-1-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQlR+33M6lK6EJh4fcYf24XyvcQofUNcqFmWgLRbmjHWokqIf0SO6SegewkiEFJ3FmU7zwY3 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Shawn Guo , Rob Herring X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Being a module_init call, highbank_pm_init will cause problem with multi-platform build running on other platforms. Call it in the .init_late hook instead. Signed-off-by: Shawn Guo --- arch/arm/mach-highbank/core.h | 5 +++++ arch/arm/mach-highbank/highbank.c | 6 ++++++ arch/arm/mach-highbank/pm.c | 4 +--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-highbank/core.h b/arch/arm/mach-highbank/core.h index 598ee78..c2e2c46 100644 --- a/arch/arm/mach-highbank/core.h +++ b/arch/arm/mach-highbank/core.h @@ -10,5 +10,10 @@ static inline void highbank_lluart_map_io(void) {} extern void highbank_smc1(int fn, int arg); extern void highbank_cpu_die(unsigned int cpu); +#ifdef CONFIG_PM +extern void highbank_pm_init(void); +#else +static inline void highbank_pm_init(void) {} +#endif extern struct smp_operations highbank_smp_ops; diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c index 709bd72..8b1c5ba 100644 --- a/arch/arm/mach-highbank/highbank.c +++ b/arch/arm/mach-highbank/highbank.c @@ -156,6 +156,11 @@ static void __init highbank_init(void) of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } +static void __init highbank_init_late(void) +{ + highbank_pm_init(); +} + static const char *highbank_match[] __initconst = { "calxeda,highbank", NULL, @@ -168,6 +173,7 @@ DT_MACHINE_START(HIGHBANK, "Highbank") .timer = &highbank_timer, .handle_irq = gic_handle_irq, .init_machine = highbank_init, + .init_late = highbank_init_late, .dt_compat = highbank_match, .restart = highbank_restart, MACHINE_END diff --git a/arch/arm/mach-highbank/pm.c b/arch/arm/mach-highbank/pm.c index 33b3beb..de866f2 100644 --- a/arch/arm/mach-highbank/pm.c +++ b/arch/arm/mach-highbank/pm.c @@ -47,9 +47,7 @@ static const struct platform_suspend_ops highbank_pm_ops = { .valid = suspend_valid_only_mem, }; -static int __init highbank_pm_init(void) +void __init highbank_pm_init(void) { suspend_set_ops(&highbank_pm_ops); - return 0; } -module_init(highbank_pm_init);