Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5351926ybi; Wed, 12 Jun 2019 00:45:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwO3FL22FhGulglddAVmFqCbrepA1taiGMcv9uQRcmLasYgqdyj8dNejFSQQUONXbJJVd6n X-Received: by 2002:a62:82c2:: with SMTP id w185mr64487007pfd.202.1560325558640; Wed, 12 Jun 2019 00:45:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560325558; cv=none; d=google.com; s=arc-20160816; b=dQN7loQgYA6ba6/Ck6GOw6fA3aHLWdyjPG+7PBzYnu/IdOqToA+lils0uJW6m2LslH Wxyp9AaE1SbJDkVWnFYbZyd9FZDh7UI6PplCB9b4udA20TDIvaUr15BKhjG4iOoXYRQl MEQ8qk5DXPJlwi+mhU7rmhorhlbGltTW7ul+uStDsjnPhrWQcX2Fu9ZwIjIvGWE9V0HD VrHTbDwmEMdDpPf+ah5kKpsHjf9/hfrEiA/s9N3E3z7XpPMz8qgDBWjAQ1yZ5EoUAXLA ezmXKyfSGFDcsivYxfKyxKGmwpqxaURddsZ7kGCqLJXmZ+1dMc43oEzeG8aDm1gGXWE3 bZ+w== 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=JyKDpFhIA2AbzhMWQhF1nywSMipQqJPNglIk1qZFQd0=; b=KRof3sVuTcqk02QXqtFnyp2vnAAEvFTjzJjmCS1RF2Czz52U/gICR8MUz0ayLMhlfd PspC7KBKVavKhJSeGgFehedZTQjFrgq3WDIGjDTcBJZ/1Ko3xXoA8LnfD2y2lmU1GUtk hHF01U0/aVE0y8AOUcV0JjLdG0Oo8SvgEpMgxCIAwZAa4fn5n5z2BIz8iqD+ys0TGeJ3 w5fNPRSXPtypMFBn1grPLp/ZS0kOHKi5x3nTbz4ZsWw7bllUwLvElxVOXwv8i4jkLHE0 //zG5+WD+PmmmG2n3aXE50uDiIfJNnLZyn1/p/ceybrf+dBV2j4JPfp5jtPUip+Z/yuc jIqA== 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 r140si15435497pgr.29.2019.06.12.00.45.41; Wed, 12 Jun 2019 00:45:58 -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 S2436548AbfFLDek (ORCPT + 99 others); Tue, 11 Jun 2019 23:34:40 -0400 Received: from inva020.nxp.com ([92.121.34.13]:52554 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404730AbfFLDei (ORCPT ); Tue, 11 Jun 2019 23:34:38 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id B62A31A0C2E; Wed, 12 Jun 2019 05:34:36 +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 35E181A00CD; Wed, 12 Jun 2019 05:34:32 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 57791402DD; Wed, 12 Jun 2019 11:34:26 +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 2/2] soc: imx8: Use existing of_root directly Date: Wed, 12 Jun 2019 11:36:20 +0800 Message-Id: <20190612033620.3556-2-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190612033620.3556-1-Anson.Huang@nxp.com> References: <20190612033620.3556-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 --- 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 86b925a..a632083 100644 --- a/drivers/soc/imx/soc-imx8.c +++ b/drivers/soc/imx/soc-imx8.c @@ -100,7 +100,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; @@ -112,12 +111,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; @@ -145,8 +143,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); @@ -156,7 +152,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