Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp668714ybi; Fri, 14 Jun 2019 01:09:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBNTN5bQMnygSp3ZZdjTKaw0LyOZwXETdieMTUys4YxJMt5V9c9oYuZ8mmttjm/TZnHXhZ X-Received: by 2002:a17:902:830b:: with SMTP id bd11mr40184631plb.202.1560499752547; Fri, 14 Jun 2019 01:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560499752; cv=none; d=google.com; s=arc-20160816; b=ET7U++MQ8Vho9bZ/3ppxvO9az0i9/u2VtlPluZVIwLstNlhom4QhXloxk+aOMZgloK dO1/thkyZiPofRMD8Hp5BBaOwYQT53DMcNTTuLbs0ZwD1QeHl7RMr8F5bTFMQqX1jTV7 9Pd48R51DMlL3cX49gtIIEcWGwE0pmvHmc7Ijj27+4EEZSAnGwEJW93SxcFxK+tMs+eJ f2eNriG+orFuyDz/z8Axoy90vHjFJLyNYGtY3375CG8Oe+zWBBeb/sRFvhrOL++UTh/L Jyt3DWb7Due6DWFCjfykYWL+sup+UWFwO0dUN/MYikQE+MPUGGHaEA6L0ekjSHhaH07Q XIMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=kK1IXM3atDeTmC67x4q1mvyqA4oeAYc0lY0URtD5oVk=; b=zu+RN2c1nhydNnh6pGmgFbvm63ggHzaC06WBCBugMrKXeF9pYjHadpYzzY4h7FNU55 YGnl7/ZmFJUFpmwSrGCPb7Rwyo0rJHQYT4nnC5cWT5Cf/x1PQQZ3hmlsi/4S0bCz9KF9 XjftQxmV7qJMygWANIHjiA3uRKkA0CMxt/6gc8EtuVWO+H0JJ2GphYC1CmJMdr+95HNs WyRGbGV+1tuI9C5OChFnJSbCSzlKgYNmZZV6kR1ZGEHEFkjaz3MVP8+eWDc9NXVsWNVa 6QzAo5FWPZWAfdu4T8Ch9Jffg5cb9FG8vseSTcphbQZEv30kOSNHpEuTMKICagvzRcE1 wxfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z20si1609973pfa.282.2019.06.14.01.08.55; Fri, 14 Jun 2019 01:09:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726429AbfFNIGH (ORCPT + 99 others); Fri, 14 Jun 2019 04:06:07 -0400 Received: from inva020.nxp.com ([92.121.34.13]:38430 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725999AbfFNIGF (ORCPT ); Fri, 14 Jun 2019 04:06:05 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id C1BA31A05DC; Fri, 14 Jun 2019 10:06:03 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 435B91A0157; Fri, 14 Jun 2019 10:05:59 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id C7ECB40310; Fri, 14 Jun 2019 16:05:53 +0800 (SGT) From: Anson.Huang@nxp.com To: shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, leonard.crestez@nxp.com, viresh.kumar@linaro.org, abel.vesa@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH V2 2/2] soc: imx8: Use existing of_root directly Date: Fri, 14 Jun 2019 16:07:48 +0800 Message-Id: <20190614080748.32997-2-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190614080748.32997-1-Anson.Huang@nxp.com> References: <20190614080748.32997-1-Anson.Huang@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anson Huang There is common of_root for reference, no need to find it from DT again, use of_root directly to make driver simple. Signed-off-by: Anson Huang Reviewed-by: Dong Aisheng --- No changes. --- drivers/soc/imx/soc-imx8.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/soc/imx/soc-imx8.c b/drivers/soc/imx/soc-imx8.c index 5c7f330..b459bf2 100644 --- a/drivers/soc/imx/soc-imx8.c +++ b/drivers/soc/imx/soc-imx8.c @@ -105,7 +105,6 @@ static int __init imx8_soc_init(void) { struct soc_device_attribute *soc_dev_attr; struct soc_device *soc_dev; - struct device_node *root; const struct of_device_id *id; u32 soc_rev = 0; const struct imx8_soc_data *data; @@ -117,12 +116,11 @@ static int __init imx8_soc_init(void) soc_dev_attr->family = "Freescale i.MX"; - root = of_find_node_by_path("/"); - ret = of_property_read_string(root, "model", &soc_dev_attr->machine); + ret = of_property_read_string(of_root, "model", &soc_dev_attr->machine); if (ret) goto free_soc; - id = of_match_node(imx8_soc_match, root); + id = of_match_node(imx8_soc_match, of_root); if (!id) { ret = -ENODEV; goto free_soc; @@ -147,8 +145,6 @@ static int __init imx8_soc_init(void) goto free_rev; } - of_node_put(root); - if (IS_ENABLED(CONFIG_ARM_IMX_CPUFREQ_DT)) platform_device_register_simple("imx-cpufreq-dt", -1, NULL, 0); @@ -159,7 +155,6 @@ static int __init imx8_soc_init(void) kfree(soc_dev_attr->revision); free_soc: kfree(soc_dev_attr); - of_node_put(root); return ret; } device_initcall(imx8_soc_init); -- 2.7.4