From patchwork Tue Jan 24 16:00:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 137581 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 04D73B6EFF for ; Wed, 25 Jan 2012 03:03:21 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Rpio0-0005ck-1I; Tue, 24 Jan 2012 16:01:08 +0000 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Rpinv-0005bL-Uc for linux-arm-kernel@lists.infradead.org; Tue, 24 Jan 2012 16:01:05 +0000 Received: from mudshark.cambridge.arm.com (mudshark.cambridge.arm.com [10.1.79.58]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id q0OG0iWq029545; Tue, 24 Jan 2012 16:00:45 GMT Date: Tue, 24 Jan 2012 16:00:44 +0000 From: Will Deacon To: Russell King - ARM Linux Subject: Re: [PATCH 21/31] ARM: amba: realview: get rid of private platform amba_device initializer Message-ID: <20120124160044.GM19798@mudshark.cambridge.arm.com> References: <20120120092207.GD1068@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Thread-Topic: [PATCH 21/31] ARM: amba: realview: get rid of private platform amba_device initializer Accept-Language: en-GB, en-US Content-Language: en-US User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Note: CRM114 invocation failed X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [217.140.96.50 listed in list.dnswl.org] -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: "linux-samsung-soc@vger.kernel.org" , "devicetree-discuss@lists.ozlabs.org" , "linux-mmc@vger.kernel.org" , STEricsson , "linux-omap@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Hi Russell, On Fri, Jan 20, 2012 at 09:29:30AM +0000, Russell King - ARM Linux wrote: > Signed-off-by: Russell King > --- > arch/arm/mach-realview/core.h | 20 ++++----------- > arch/arm/mach-realview/realview_eb.c | 38 +++++++++++++++--------------- > arch/arm/mach-realview/realview_pb1176.c | 38 +++++++++++++++--------------- > arch/arm/mach-realview/realview_pb11mp.c | 38 +++++++++++++++--------------- > arch/arm/mach-realview/realview_pba8.c | 38 +++++++++++++++--------------- > arch/arm/mach-realview/realview_pbx.c | 38 +++++++++++++++--------------- > 6 files changed, 100 insertions(+), 110 deletions(-) After applying this patch, I get compile-time errors in realview_*.c. E.g.: arch/arm/mach-realview/realview_pb1176.c:158:1: error: ‘AACI’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:159:1: error: ‘MMCI0’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:160:1: error: ‘KMI0’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:161:1: error: ‘KMI1’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:162:1: error: ‘PB1176_UART4’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:165:1: error: ‘PB1176_SMC’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:166:1: error: ‘SCTL’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:167:1: error: ‘PB1176_WATCHDOG’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:168:1: error: ‘PB1176_GPIO0’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:169:1: error: ‘GPIO1’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:170:1: error: ‘GPIO2’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:171:1: error: ‘PB1176_RTC’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:172:1: error: ‘SCI’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:173:1: error: ‘PB1176_UART0’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:174:1: error: ‘PB1176_UART1’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:175:1: error: ‘PB1176_UART2’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:176:1: error: ‘PB1176_UART3’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:177:1: error: ‘PB1176_SSP’ undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:178:1: error: ‘PB1176_CLCD’ undeclared here (not in a function) > diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h > index 735b57a..b1c6097 100644 > --- a/arch/arm/mach-realview/core.h > +++ b/arch/arm/mach-realview/core.h > @@ -28,21 +28,11 @@ > #include > #include > > -#define AMBA_DEVICE(name,busid,base,plat) \ > -static struct amba_device name##_device = { \ > - .dev = { \ > - .coherent_dma_mask = ~0, \ > - .init_name = busid, \ > - .platform_data = plat, \ > - }, \ > - .res = { \ > - .start = REALVIEW_##base##_BASE, \ > - .end = (REALVIEW_##base##_BASE) + SZ_4K - 1, \ > - .flags = IORESOURCE_MEM, \ > - }, Which is because the old AMBA_DEVICE macro munges REALVIEW_ and _BASE around the peripheral identifier... > +#define APB_DEVICE(name, busid, base, plat) \ > +static AMBA_APB_DEVICE(name, busid, 0, base, base##_IRQ, plat) > + > +#define AHB_DEVICE(name, busid, base, plat) \ > +static AMBA_AHB_DEVICE(name, busid, 0, base, base##_IRQ, plat) ...whereas the new macros just use base directly. Fixing the macro solves the build problem: but then I see a warning during boot: [ 1.669654] ------------[ cut here ]------------ [ 1.684021] WARNING: at drivers/amba/bus.c:514 amba_device_add+0x1b4/0x1d0() [ 1.705585] Modules linked in: [ 1.715195] [] (unwind_backtrace+0x0/0xfc) from [] (dump_stack+0x20/0x24) [ 1.741288] [] (dump_stack+0x20/0x24) from [] (warn_slowpath_common+0x5c/0x74) [ 1.768689] [] (warn_slowpath_common+0x5c/0x74) from [] (warn_slowpath_null+0x2c/0x34) [ 1.798165] [] (warn_slowpath_null+0x2c/0x34) from [] (amba_device_add+0x1b4/0x1d0) [ 1.826857] [] (amba_device_add+0x1b4/0x1d0) from [] (amba_device_register+0x94/0xc4) [ 1.856106] [] (amba_device_register+0x94/0xc4) from [] (realview_pb1176_init+0x74/0xac) [ 1.886120] [] (realview_pb1176_init+0x74/0xac) from [] (customize_machine+0x24/0x30) [ 1.915340] [] (customize_machine+0x24/0x30) from [] (do_one_initcall+0x48/0x1a0) [ 1.943505] [] (do_one_initcall+0x48/0x1a0) from [] (kernel_init+0x80/0x128) [ 1.970378] [] (kernel_init+0x80/0x128) from [] (kernel_thread_exit+0x0/0x8) [ 1.997192] ---[ end trace 1b75b31a2719ed1e ]--- I suspect that comes from PB1176_GPIO0_IRQ being -1. Will Acked-by: Will Deacon diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h index b1c6097..f8f2c0a 100644 --- a/arch/arm/mach-realview/core.h +++ b/arch/arm/mach-realview/core.h @@ -29,10 +29,10 @@ #include #define APB_DEVICE(name, busid, base, plat) \ -static AMBA_APB_DEVICE(name, busid, 0, base, base##_IRQ, plat) +static AMBA_APB_DEVICE(name, busid, 0, REALVIEW_##base##_BASE, base##_IRQ, plat) #define AHB_DEVICE(name, busid, base, plat) \ -static AMBA_AHB_DEVICE(name, busid, 0, base, base##_IRQ, plat) +static AMBA_AHB_DEVICE(name, busid, 0, REALVIEW_##base##_BASE, base##_IRQ, plat) struct machine_desc;