Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3553553ybi; Tue, 18 Jun 2019 02:42:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSTLktjALmZ6idcVncVXwOiDLfO/fmFFPuZjQ6vFSQYddf0//EeiZ2bsbBrmmo9SG9lcQ5 X-Received: by 2002:aa7:8ecb:: with SMTP id b11mr78692777pfr.220.1560850942834; Tue, 18 Jun 2019 02:42:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560850942; cv=none; d=google.com; s=arc-20160816; b=x92g3at4A4sTZidUDvXmozz8PTC8dKpoB15QAFTlJMpt8EnezOks0BGECWc0J8+aEB 6ukYMPcrLKognFUUR6dPQlF16KtgsxAnOAXr6cIN4cZsfT7ZH3oJNdBdZwAV1HXFAG3o OB5Ipxi6ISxtrZla37L92RMQwnkj/4yhJIh3IWFoo+IdNO7BSllCQ+qGDBh4o5lZu6KT qvlPnTqlTm1LGmDRB4BzQrzIVhnl6+214z0yBcvPqcBXX3Cv1WjII/h8/i+XuYE2cgWa 5cT2bi8s0SwwbK70tYy+lNOyrmPV2l0cm7fATvsRyoVMQDqJxHBIWNawbFaTdkOG0Etr /ewA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=HIHjlaSvcH1MMMKDRoBr1Rhv7+fXUHy7bKgeRF1Cb1A=; b=cW21soOiWIBbUix9AHNJ//vOFe4d9zkJ2W8/OKZSJVuA1ZD0SZta1IgriBlNdObeYq YIx+UXiiYvLc30y5e6FaF97MQ4OJxr+Gty+jRnatEgieJsKwud/95VCi6pMy4y5+6SpB 4BFzb+N4uIHG6BNJYqUcQjhVfE7y7ulLxp3iCjcKpNsSdGWJbaYiUgAUc27+g5x/5CuJ NXFNnZRgzL2uoJHKVv76Ni+iBI6H3vkMTCX8wSCnMV9u9gpEl6Ohw77UKCs2Oxfv3ItN NWQO8wRAC6ptJDUKXwBJ6vq7OrtH1PgSatzse2mToaiteAo/R7e7oenXVuBts0UlIu2q GZPA== 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 23si1827086pjx.87.2019.06.18.02.42.04; Tue, 18 Jun 2019 02:42:22 -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 S1729437AbfFRJl5 (ORCPT + 99 others); Tue, 18 Jun 2019 05:41:57 -0400 Received: from inva021.nxp.com ([92.121.34.21]:57626 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729230AbfFRJl4 (ORCPT ); Tue, 18 Jun 2019 05:41:56 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 4BFD72003B7; Tue, 18 Jun 2019 11:41:55 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 2936C200269; Tue, 18 Jun 2019 11:41:51 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id BEF8A402A0; Tue, 18 Jun 2019 17:41:45 +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, abel.vesa@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Linux-imx@nxp.com Subject: [PATCH RESEND V2] soc: imx8: Use existing of_root directly Date: Tue, 18 Jun 2019 17:43:38 +0800 Message-Id: <20190618094338.11183-1-Anson.Huang@nxp.com> X-Mailer: git-send-email 2.17.1 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 ef2406f..34ab993 100644 --- a/drivers/soc/imx/soc-imx8.c +++ b/drivers/soc/imx/soc-imx8.c @@ -94,7 +94,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; @@ -106,12 +105,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; @@ -136,8 +134,6 @@ static int __init imx8_soc_init(void) goto free_rev; } - of_node_put(root); - return 0; free_rev: @@ -145,7 +141,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