From patchwork Wed Mar 19 19:29:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 3861051 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 087CBBF540 for ; Wed, 19 Mar 2014 20:32:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 24ED1201F9 for ; Wed, 19 Mar 2014 20:32:54 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 111D5201F5 for ; Wed, 19 Mar 2014 20:32:53 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQML5-0004QE-7h; Wed, 19 Mar 2014 19:39:48 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQMK9-0006Ew-Hj; Wed, 19 Mar 2014 19:38:49 +0000 Received: from bombadil.infradead.org ([2001:1868:205::9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQMCq-0005cX-LY for linux-arm-kernel@merlin.infradead.org; Wed, 19 Mar 2014 19:31:16 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WQMCn-0004fJ-Vr for linux-arm-kernel@lists.infradead.org; Wed, 19 Mar 2014 19:31:14 +0000 Received: from wuerfel.lan (HSI-KBW-134-3-135-108.hsi14.kabel-badenwuerttemberg.de [134.3.135.108]) by mrelayeu.kundenserver.de (node=mreue105) with ESMTP (Nemesis) id 0MPGl6-1WUjv13yPg-004TxO; Wed, 19 Mar 2014 20:30:44 +0100 From: Arnd Bergmann To: arm@kernel.org Subject: [PATCH 49/62] ARM: s5p64x0: fix building with only one soc type Date: Wed, 19 Mar 2014 20:29:46 +0100 Message-Id: <1395257399-359545-50-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1395257399-359545-1-git-send-email-arnd@arndb.de> References: <1395257399-359545-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:A5Qq0gc/kJ3pRhhOgTYbBYnlgIKPcEuOB9qZTcAUTP1 HoJaoUv49v3Lqyj2a8DMWLhddyEQ7g2zKt2oSp0fYSG6+HUt7j 2a53lc+485yCRTuQVs/SW5F13nyOMsaBH5X87ty6fPqtiLkZHF HJPsTMqDJg5c2HMmoTW/JlODq5o0UsJqK67pgt2Vb5CJY7XNeT ex2+30Z/JCeNFshIK0QPZdxe6bEWWxrhYT3Rl8CtPfoG0MhtSi jLFyR4yY/b6wgpsWQaF96iXMFlYlWQH/Zcp+AHYdArOYk4X3S/ 0sAECCfzgket4l9fzU6/JfmC4DUtJ//3ig88VOq5oYXGEWofTw qvbCOzizAEE7VbBpj45G2pfKay98+W11/jMynCVtK X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140319_123114_402141_5FDA6DD1 X-CRM114-Status: GOOD ( 12.90 ) X-Spam-Score: -0.0 (/) Cc: Kukjin Kim , Ben Dooks , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, Tomasz Figa X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The s5p64x0 platform supports two distinct SoCs, s5p6440 and s5p6450, and in the normal configuration, both are enabled. However if we build a kernel that only enables one of the two, the #ifdef logic in common.c breaks down, as some of the functions declared in the header are defined to NULL using the preprocessor but then defined anyway. This patch cleans up the mess and ensures that each function has either exactly one C declaration and one matching C definition, or we have a NULL defined function pointer but no C definition. Signed-off-by: Arnd Bergmann Cc: Tomasz Figa Cc: Kukjin Kim Cc: Ben Dooks Acked-by: Kukjin Kim --- arch/arm/mach-s5p64x0/common.c | 18 ++++++++++++++++-- arch/arm/mach-s5p64x0/common.h | 5 +---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c index eb2ad14..9a43be0 100644 --- a/arch/arm/mach-s5p64x0/common.c +++ b/arch/arm/mach-s5p64x0/common.c @@ -205,6 +205,7 @@ void __init s5p64x0_init_io(struct map_desc *mach_desc, int size) samsung_pwm_set_platdata(&s5p64x0_pwm_variant); } +#ifdef CONFIG_CPU_S5P6440 void __init s5p6440_map_io(void) { /* initialize any device information early */ @@ -218,7 +219,9 @@ void __init s5p6440_map_io(void) iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc)); } +#endif +#ifdef CONFIG_CPU_S5P6450 void __init s5p6450_map_io(void) { /* initialize any device information early */ @@ -232,13 +235,14 @@ void __init s5p6450_map_io(void) iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc)); } +#endif /* * s5p64x0_init_clocks * * register and setup the CPU clocks */ - +#ifdef CONFIG_CPU_S5P6440 void __init s5p6440_init_clocks(int xtal) { printk(KERN_DEBUG "%s: initializing clocks\n", __func__); @@ -248,7 +252,9 @@ void __init s5p6440_init_clocks(int xtal) s5p6440_register_clocks(); s5p6440_setup_clocks(); } +#endif +#ifdef CONFIG_CPU_S5P6450 void __init s5p6450_init_clocks(int xtal) { printk(KERN_DEBUG "%s: initializing clocks\n", __func__); @@ -258,13 +264,14 @@ void __init s5p6450_init_clocks(int xtal) s5p6450_register_clocks(); s5p6450_setup_clocks(); } +#endif /* * s5p64x0_init_irq * * register the CPU interrupts */ - +#ifdef CONFIG_CPU_S5P6440 void __init s5p6440_init_irq(void) { /* S5P6440 supports 2 VIC */ @@ -279,7 +286,9 @@ void __init s5p6440_init_irq(void) s5p_init_irq(vic, ARRAY_SIZE(vic)); } +#endif +#ifdef CONFIG_CPU_S5P6450 void __init s5p6450_init_irq(void) { /* S5P6450 supports only 2 VIC */ @@ -294,6 +303,7 @@ void __init s5p6450_init_irq(void) s5p_init_irq(vic, ARRAY_SIZE(vic)); } +#endif struct bus_type s5p64x0_subsys = { .name = "s5p64x0-core", @@ -321,6 +331,7 @@ int __init s5p64x0_init(void) } /* uart registration process */ +#ifdef CONFIG_CPU_S5P6440 void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no) { int uart; @@ -332,11 +343,14 @@ void __init s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no) s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); } +#endif +#ifdef CONFIG_CPU_S5P6450 void __init s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no) { s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); } +#endif #define eint_offset(irq) ((irq) - IRQ_EINT(0)) diff --git a/arch/arm/mach-s5p64x0/common.h b/arch/arm/mach-s5p64x0/common.h index f3a9b43..cbe7f3d 100644 --- a/arch/arm/mach-s5p64x0/common.h +++ b/arch/arm/mach-s5p64x0/common.h @@ -25,10 +25,10 @@ void s5p6450_register_clocks(void); void s5p6450_setup_clocks(void); void s5p64x0_restart(enum reboot_mode mode, const char *cmd); +extern int s5p64x0_init(void); #ifdef CONFIG_CPU_S5P6440 -extern int s5p64x0_init(void); extern void s5p6440_map_io(void); extern void s5p6440_init_clocks(int xtal); @@ -38,12 +38,10 @@ extern void s5p6440_init_uarts(struct s3c2410_uartcfg *cfg, int no); #define s5p6440_init_clocks NULL #define s5p6440_init_uarts NULL #define s5p6440_map_io NULL -#define s5p64x0_init NULL #endif #ifdef CONFIG_CPU_S5P6450 -extern int s5p64x0_init(void); extern void s5p6450_map_io(void); extern void s5p6450_init_clocks(int xtal); @@ -53,7 +51,6 @@ extern void s5p6450_init_uarts(struct s3c2410_uartcfg *cfg, int no); #define s5p6450_init_clocks NULL #define s5p6450_init_uarts NULL #define s5p6450_map_io NULL -#define s5p64x0_init NULL #endif #endif /* __ARCH_ARM_MACH_S5P64X0_COMMON_H */