From patchwork Wed Dec 19 19:26:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 1896901 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 049BC3FC64 for ; Wed, 19 Dec 2012 19:29:51 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TlPHk-0003zZ-62; Wed, 19 Dec 2012 19:26:32 +0000 Received: from mho-04-ewr.mailhop.org ([204.13.248.74] helo=mho-02-ewr.mailhop.org) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TlPHT-0003wx-Sy for linux-arm-kernel@lists.infradead.org; Wed, 19 Dec 2012 19:26:16 +0000 Received: from c-50-131-214-131.hsd1.ca.comcast.net ([50.131.214.131] helo=muffinssi.local) by mho-02-ewr.mailhop.org with esmtpa (Exim 4.72) (envelope-from ) id 1TlPHT-0002Fh-Gy; Wed, 19 Dec 2012 19:26:15 +0000 X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 50.131.214.131 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+8LS0HP89fD8AjfedNAR4z Subject: [PATCH 1/8] ARM: OMAP2+: Limi omap initcalls to omap only on multiplatform kernels To: linux-arm-kernel@lists.infradead.org From: Tony Lindgren Date: Wed, 19 Dec 2012 11:26:14 -0800 Message-ID: <20121219192614.22098.89676.stgit@muffinssi.local> In-Reply-To: <20121219192354.22098.33408.stgit@muffinssi.local> References: <20121219192354.22098.33408.stgit@muffinssi.local> User-Agent: StGit/0.16-1-ga54b MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121219_142616_034774_F2BD39E5 X-CRM114-Status: GOOD ( 12.09 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [204.13.248.74 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linux-omap@vger.kernel.org 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: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org We need to make sure that multiplatform kernels don't run omap initcalls when booted on other SoCs. Do this by adding wrapper macros for the initcalls that return early if soc_is_omap() test fails. This allows us to easily change the defines later if we have SoC specific init sections available. Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/soc.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h index f31d907..092aedd 100644 --- a/arch/arm/mach-omap2/soc.h +++ b/arch/arm/mach-omap2/soc.h @@ -42,6 +42,9 @@ #undef MULTI_OMAP2 #undef OMAP_NAME +#ifdef CONFIG_ARCH_MULTIPLATFORM +#define MULTI_OMAP2 +#endif #ifdef CONFIG_SOC_OMAP2420 # ifdef OMAP_NAME # undef MULTI_OMAP2 @@ -112,6 +115,11 @@ int omap_type(void); */ unsigned int omap_rev(void); +static inline int soc_is_omap(void) +{ + return omap_rev() != 0; +} + /* * Get the CPU revision for OMAP devices */ @@ -465,5 +473,26 @@ static inline unsigned int omap4_has_ ##feat(void) \ OMAP4_HAS_FEATURE(perf_silicon, PERF_SILICON) +/* + * We need to make sure omap initcalls don't run when + * multiplatform kernels are booted on other SoCs. + */ +#define omap_initcall(level, fn) \ +static int __init __used __##fn(void) \ +{ \ + if (!soc_is_omap()) \ + return 0; \ + return fn(); \ +} \ +level(__##fn); + +#define omap_early_initcall(fn) omap_initcall(early_initcall, fn) +#define omap_core_initcall(fn) omap_initcall(core_initcall, fn) +#define omap_postcore_initcall(fn) omap_initcall(postcore_initcall, fn) +#define omap_arch_initcall(fn) omap_initcall(arch_initcall, fn) +#define omap_subsys_initcall(fn) omap_initcall(subsys_initcall, fn) +#define omap_device_initcall(fn) omap_initcall(device_initcall, fn) +#define omap_late_initcall(fn) omap_initcall(late_initcall, fn) + #endif /* __ASSEMBLY__ */