From patchwork Wed Nov 16 16:39:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 695688 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tJqlY194hz9rxm for ; Thu, 17 Nov 2016 03:41:29 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3tJqlY0N6MzDvr9 for ; Thu, 17 Nov 2016 03:41:29 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by lists.ozlabs.org (Postfix) with ESMTP id 3tJqjR0WfszDvgn for ; Thu, 17 Nov 2016 03:39:37 +1100 (AEDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 962221597; Wed, 16 Nov 2016 08:39:34 -0800 (PST) Received: from e107155-lin.cambridge.arm.com (unknown [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 91C073F218; Wed, 16 Nov 2016 08:39:33 -0800 (PST) From: Sudeep Holla To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 2/2] soc: fsl: fix section mismatch build warnings Date: Wed, 16 Nov 2016 16:39:27 +0000 Message-Id: <1479314367-9169-2-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479314367-9169-1-git-send-email-sudeep.holla@arm.com> References: <1479314367-9169-1-git-send-email-sudeep.holla@arm.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Scott Wood , Yangbo Lu , linux-kernel@vger.kernel.org, Arnd Bergmann , Sudeep Holla Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" We get the following warning with the driver is compiled in: WARNING: modpost: Found 1 section mismatch(es). To see full details build your kernel with: 'make CONFIG_DEBUG_SECTION_MISMATCH=y' With CONFIG_DEBUG_SECTION_MISMATCH enabled, the details are reported: WARNING: vmlinux.o(.text+0x55d014): Section mismatch in reference from the function fsl_guts_probe() to the function .init.text:of_flat_dt_get_machine_name() The function fsl_guts_probe() references the function __init of_flat_dt_get_machine_name(). This is often because fsl_guts_probe lacks a __init annotation or the annotation of of_flat_dt_get_machine_name is wrong. This patch stashes the machine name during fsl_guts_init initcall to fix the above warnings. Cc: Scott Wood Cc: Yangbo Lu Cc: Arnd Bergmann Signed-off-by: Sudeep Holla --- drivers/soc/fsl/guts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index 885409d84eb2..5513a2b3448f 100644 --- a/drivers/soc/fsl/guts.c +++ b/drivers/soc/fsl/guts.c @@ -31,6 +31,7 @@ struct fsl_soc_die_attr { static struct guts *guts; static struct soc_device_attribute soc_dev_attr; static struct soc_device *soc_dev; +static const char *machine; /* SoC die attribute definition for QorIQ platform */ @@ -135,7 +136,6 @@ static int fsl_guts_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct resource *res; const struct fsl_soc_die_attr *soc_die; - const char *machine; u32 svr; /* Initialize guts */ @@ -151,7 +151,6 @@ static int fsl_guts_probe(struct platform_device *pdev) return PTR_ERR(guts->regs); /* Register soc device */ - machine = of_flat_dt_get_machine_name(); if (machine) soc_dev_attr.machine = devm_kstrdup(dev, machine, GFP_KERNEL); @@ -223,6 +222,7 @@ static struct platform_driver fsl_guts_driver = { static int __init fsl_guts_init(void) { + machine = of_flat_dt_get_machine_name(); return platform_driver_register(&fsl_guts_driver); } core_initcall(fsl_guts_init);