From patchwork Mon Oct 17 06:15:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 4698 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AB5F923E51 for ; Mon, 17 Oct 2011 06:12:03 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 934EEA18459 for ; Mon, 17 Oct 2011 06:12:03 +0000 (UTC) Received: by mail-bw0-f52.google.com with SMTP id zs2so6756792bkb.11 for ; Sun, 16 Oct 2011 23:12:03 -0700 (PDT) Received: by 10.223.4.215 with SMTP id 23mr4519138fas.8.1318831923239; Sun, 16 Oct 2011 23:12:03 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.24.41 with SMTP id r9cs89290laf; Sun, 16 Oct 2011 23:12:03 -0700 (PDT) Received: by 10.150.103.8 with SMTP id a8mr498153ybc.11.1318831922187; Sun, 16 Oct 2011 23:12:02 -0700 (PDT) Received: from mail-yx0-f174.google.com (mail-yx0-f174.google.com [209.85.213.174]) by mx.google.com with ESMTPS id g10si3497867ybi.95.2011.10.16.23.12.01 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Oct 2011 23:12:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.213.174 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.213.174; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.213.174 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by yxp4 with SMTP id 4so3355585yxp.5 for ; Sun, 16 Oct 2011 23:12:01 -0700 (PDT) Received: by 10.68.14.97 with SMTP id o1mr36706562pbc.0.1318831921252; Sun, 16 Oct 2011 23:12:01 -0700 (PDT) Received: from localhost.localdomain ([117.82.23.149]) by mx.google.com with ESMTPS id ko15sm21528378pbb.9.2011.10.16.23.11.43 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Oct 2011 23:12:00 -0700 (PDT) From: Shawn Guo To: Arnd Bergmann , Chris Ball Cc: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, Sascha Hauer , patches@linaro.org, Shawn Guo Subject: [PATCH 3/5] arm/imx: remove mx27_setup_weimcs() from mx27.h Date: Mon, 17 Oct 2011 14:15:08 +0800 Message-Id: <1318832110-29289-4-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1318832110-29289-1-git-send-email-shawn.guo@linaro.org> References: <1318832110-29289-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 The helper function mx27_setup_weimcs() references IOMEM() and IMX_IO_P2V() but without required header mach/hardware.h included in mx27.h. This will break the build of those mx27 file with no direct inclusion of mach/hardware.h, or when indirect inclusion to mach/hardware.h breaks. For example, when the inclusion of mach/hardware.h gets removed from mach/gpio.h, we will see the following compile error. CC arch/arm/mach-imx/pm-imx27.o In file included from arch/arm/mach-imx/pm-imx27.c:14:0: arch/arm/plat-mxc/include/mach/mx27.h: In function ‘mx27_setup_weimcs’: arch/arm/plat-mxc/include/mach/mx27.h:138:2: error: implicit declaration of function ‘IOMEM’ arch/arm/plat-mxc/include/mach/mx27.h:138:2: error: implicit declaration of function ‘IMX_IO_P2V’ This patch removes mx27_setup_weimcs() from mx27.h and makes it local to mach-pcm038.c, which is the only user for this helper. Signed-off-by: Shawn Guo --- arch/arm/mach-imx/mach-pcm038.c | 4 +++- arch/arm/plat-mxc/include/mach/mx27.h | 14 -------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c index f0a5282..100bc73 100644 --- a/arch/arm/mach-imx/mach-pcm038.c +++ b/arch/arm/mach-imx/mach-pcm038.c @@ -176,7 +176,9 @@ static struct platform_device *platform_devices[] __initdata = { * setup other stuffs to access the sram. */ static void __init pcm038_init_sram(void) { - mx27_setup_weimcs(1, 0x0000d843, 0x22252521, 0x22220a00); + __raw_writel(0x0000d843, MX27_IO_ADDRESS(MX27_WEIM_CSCRxU(1))); + __raw_writel(0x22252521, MX27_IO_ADDRESS(MX27_WEIM_CSCRxL(1))); + __raw_writel(0x22220a00, MX27_IO_ADDRESS(MX27_WEIM_CSCRxA(1))); } static const struct imxi2c_platform_data pcm038_i2c1_data __initconst = { diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h index 1dc1c52..6265357 100644 --- a/arch/arm/plat-mxc/include/mach/mx27.h +++ b/arch/arm/plat-mxc/include/mach/mx27.h @@ -24,10 +24,6 @@ #ifndef __MACH_MX27_H__ #define __MACH_MX27_H__ -#ifndef __ASSEMBLER__ -#include -#endif - #define MX27_AIPI_BASE_ADDR 0x10000000 #define MX27_AIPI_SIZE SZ_1M #define MX27_DMA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x01000) @@ -131,16 +127,6 @@ #define MX27_IO_P2V(x) IMX_IO_P2V(x) #define MX27_IO_ADDRESS(x) IOMEM(MX27_IO_P2V(x)) -#ifndef __ASSEMBLER__ -static inline void mx27_setup_weimcs(size_t cs, - unsigned upper, unsigned lower, unsigned addional) -{ - __raw_writel(upper, MX27_IO_ADDRESS(MX27_WEIM_CSCRxU(cs))); - __raw_writel(lower, MX27_IO_ADDRESS(MX27_WEIM_CSCRxL(cs))); - __raw_writel(addional, MX27_IO_ADDRESS(MX27_WEIM_CSCRxA(cs))); -} -#endif - /* fixed interrupt numbers */ #define MX27_INT_I2C2 1 #define MX27_INT_GPT6 2