From patchwork Thu Nov 17 15:11:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 9434821 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A379A6047D for ; Thu, 17 Nov 2016 17:38:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 972DF21050 for ; Thu, 17 Nov 2016 17:38:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BEFE2939E; Thu, 17 Nov 2016 17:38:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0988F21050 for ; Thu, 17 Nov 2016 17:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941458AbcKQRhW (ORCPT ); Thu, 17 Nov 2016 12:37:22 -0500 Received: from foss.arm.com ([217.140.101.70]:57234 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941460AbcKQRhV (ORCPT ); Thu, 17 Nov 2016 12:37:21 -0500 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 70D4215BE; Thu, 17 Nov 2016 07:12:06 -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 4E74B3F24D; Thu, 17 Nov 2016 07:12:05 -0800 (PST) From: Sudeep Holla To: linux-kernel@vger.kernel.org Cc: Sudeep Holla , linux-mmc@vger.kernel.org, Scott Wood , Yangbo Lu , Arnd Bergmann , Ulf Hansson Subject: [PATCH v2 -next] soc: fsl: fix section mismatch build warnings Date: Thu, 17 Nov 2016 15:11:59 +0000 Message-Id: <1479395519-20742-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479314367-9169-2-git-send-email-sudeep.holla@arm.com> References: <1479314367-9169-2-git-send-email-sudeep.holla@arm.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 fixes the issue by using the normal DT/OF API rather than the of_flat_* one. Cc: Scott Wood Cc: Yangbo Lu Cc: Arnd Bergmann Cc: Ulf Hansson Signed-off-by: Sudeep Holla --- drivers/soc/fsl/guts.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) v1->v2: - As suggested by Arnd, used standard DT APIs over of_flat_* API -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c index 0ac88263c2d7..6af7a11f09a5 100644 --- a/drivers/soc/fsl/guts.c +++ b/drivers/soc/fsl/guts.c @@ -132,7 +132,7 @@ EXPORT_SYMBOL(fsl_guts_get_svr); static int fsl_guts_probe(struct platform_device *pdev) { - struct device_node *np = pdev->dev.of_node; + struct device_node *root, *np = pdev->dev.of_node; struct device *dev = &pdev->dev; struct resource *res; const struct fsl_soc_die_attr *soc_die; @@ -152,7 +152,10 @@ static int fsl_guts_probe(struct platform_device *pdev) return PTR_ERR(guts->regs); /* Register soc device */ - machine = of_flat_dt_get_machine_name(); + root = of_find_node_by_path("/"); + if (of_property_read_string(root, "model", &machine)) + of_property_read_string_index(root, "compatible", 0, &machine); + of_node_put(root); if (machine) soc_dev_attr.machine = devm_kstrdup(dev, machine, GFP_KERNEL);