lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1577696316-27635-1-git-send-email-peng.fan@nxp.com>
Date:   Mon, 30 Dec 2019 09:03:51 +0000
From:   Peng Fan <peng.fan@....com>
To:     "shawnguo@...nel.org" <shawnguo@...nel.org>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        "festevam@...il.com" <festevam@...il.com>
CC:     dl-linux-imx <linux-imx@....com>,
        Anson Huang <anson.huang@....com>,
        Leonard Crestez <leonard.crestez@....com>,
        "cniedermaier@...electronics.com" <cniedermaier@...electronics.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Alice Guo <alice.guo@....com>, Peng Fan <peng.fan@....com>
Subject: [PATCH] ARM: imx: use of_root to simplify code

From: Peng Fan <peng.fan@....com>

start_kernel
     |->setup_arch
     |       |->unflatten_device_tree->of_root ready
     |
     |->do_initcalls
           |->customize_machine
                       |->init_machine
                              |->imx_soc_device_init

When imx_soc_device_init, of_root is ready, so we could directly use it.

Signed-off-by: Peng Fan <peng.fan@....com>
---

V1:
 Tested on i.MX7D-SDB

 arch/arm/mach-imx/cpu.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c
index 06f8d64b65af..77319b359070 100644
--- a/arch/arm/mach-imx/cpu.c
+++ b/arch/arm/mach-imx/cpu.c
@@ -88,7 +88,6 @@ struct device * __init imx_soc_device_init(void)
 	struct soc_device_attribute *soc_dev_attr;
 	const char *ocotp_compat = NULL;
 	struct soc_device *soc_dev;
-	struct device_node *root;
 	struct regmap *ocotp = NULL;
 	const char *soc_id;
 	u64 soc_uid = 0;
@@ -101,9 +100,7 @@ struct device * __init imx_soc_device_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);
-	of_node_put(root);
+	ret = of_property_read_string(of_root, "model", &soc_dev_attr->machine);
 	if (ret)
 		goto free_soc;
 
-- 
2.16.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ