From patchwork Fri Oct 12 11:14:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 1586411 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 30F6FDFF71 for ; Fri, 12 Oct 2012 11:17:19 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TMdD6-0001b7-UG; Fri, 12 Oct 2012 11:15:20 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TMdD2-0001at-KJ for linux-arm-kernel@lists.infradead.org; Fri, 12 Oct 2012 11:15:19 +0000 Received: from klappe2.localnet (deibp9eh1--blueice3n2.emea.ibm.com [195.212.29.180]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LkBS6-1TxKX12UXa-00c7pB; Fri, 12 Oct 2012 13:14:53 +0200 From: Arnd Bergmann To: Russell King Subject: [PATCH] ARM: s3c: mark s3c2440_clk_add as __init_refok Date: Fri, 12 Oct 2012 11:14:52 +0000 User-Agent: KMail/1.12.2 (Linux/3.5.0; KDE/4.3.2; x86_64; ; ) MIME-Version: 1.0 Message-Id: <201210121114.52348.arnd@arndb.de> X-Provags-ID: V02:K0:d2cxu9anZiO0q/HsGv0tgJ+rbLEchg+DnTWfLUGxdSW ihjBtf2Ejzjj0jiXoAxxnNpeI8J5ZoXn/5eGM+eWMKGxVPKrMu 72zTzekY7QMXDZEsqWoevYDqc75qflPcVrfWzbpjErxCOPiFPB ik1r/OsCMb2z+OX7aZzacz66XRUY4yWjh8k+4C05LmMXTGGAzp 0TlJ4R6y/ofEjPM7bdaEPwjxH92Iqi6cM303tJBqWU/NGgXsR/ KZ7RgIPdCjTDphZQy7jFrkbchfp2XCExHloK1IBhkZuSpYRxbu CoXKusGgtd2SAgtF6oQPlXeLBOZynuy+/Cy5sKqsUztrtU2Amk pL41Gh6HLtoL9R6WozHE= X-Spam-Note: CRM114 invocation failed 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 [212.227.17.10 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Kukjin Kim , Mike Turquette , linux-arm-kernel@lists.infradead.org, Ben Dooks , linux-kernel@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 s3c2440_clk_add is a subsys_interface method and calls clkdev_add_table, which is marked as __init. The modpost script complains about this because we must not call an __init function from a function in the .text section, and we cannot reference an __init function from a subsys_interface pointer. I have verified that the only code path into s3c2440_clk_add() is from "int __init s3c2440_init(void)", so s3c2440_clk_add can be marked __init_refok instead. Without this patch, building mini2440_defconfig results in: WARNING: vmlinux.o(.text+0x9848): Section mismatch in reference from the function s3c2440_clk_add() to the function .init.text:clkdev_add_table() The function s3c2440_clk_add() references the function __init clkdev_add_table(). This is often because s3c2440_clk_add lacks a __init annotation or the annotation of clkdev_add_table is wrong. Signed-off-by: Arnd Bergmann Cc: Russell King Cc: Mike Turquette Cc: Kukjin Kim Cc: Ben Dooks Acked-by: Kukjin Kim --- I'll put this into arm-soc/fixes unless I hear objections. This replaces the earlier "clk: don't mark clkdev_add_table as init" as suggested by Russell. diff --git a/arch/arm/mach-s3c24xx/clock-s3c2440.c b/arch/arm/mach-s3c24xx/clock-s3c2440.c index 749220f..4407b17 100644 --- a/arch/arm/mach-s3c24xx/clock-s3c2440.c +++ b/arch/arm/mach-s3c24xx/clock-s3c2440.c @@ -163,7 +163,7 @@ static struct clk_lookup s3c2440_clk_lookup[] = { CLKDEV_INIT(NULL, "clk_uart_baud3", &s3c2440_clk_fclk_n), }; -static int s3c2440_clk_add(struct device *dev, struct subsys_interface *sif) +static int __init_refok s3c2440_clk_add(struct device *dev, struct subsys_interface *sif) { struct clk *clock_upll; struct clk *clock_h;