mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
soc: imx8: Use existing of_root directly
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 <Anson.Huang@nxp.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
This commit is contained in:
parent
1bcbe73008
commit
283172b019
1 changed files with 2 additions and 7 deletions
|
@ -94,7 +94,6 @@ static int __init imx8_soc_init(void)
|
||||||
{
|
{
|
||||||
struct soc_device_attribute *soc_dev_attr;
|
struct soc_device_attribute *soc_dev_attr;
|
||||||
struct soc_device *soc_dev;
|
struct soc_device *soc_dev;
|
||||||
struct device_node *root;
|
|
||||||
const struct of_device_id *id;
|
const struct of_device_id *id;
|
||||||
u32 soc_rev = 0;
|
u32 soc_rev = 0;
|
||||||
const struct imx8_soc_data *data;
|
const struct imx8_soc_data *data;
|
||||||
|
@ -106,12 +105,11 @@ static int __init imx8_soc_init(void)
|
||||||
|
|
||||||
soc_dev_attr->family = "Freescale i.MX";
|
soc_dev_attr->family = "Freescale i.MX";
|
||||||
|
|
||||||
root = of_find_node_by_path("/");
|
ret = of_property_read_string(of_root, "model", &soc_dev_attr->machine);
|
||||||
ret = of_property_read_string(root, "model", &soc_dev_attr->machine);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
goto free_soc;
|
goto free_soc;
|
||||||
|
|
||||||
id = of_match_node(imx8_soc_match, root);
|
id = of_match_node(imx8_soc_match, of_root);
|
||||||
if (!id) {
|
if (!id) {
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto free_soc;
|
goto free_soc;
|
||||||
|
@ -136,8 +134,6 @@ static int __init imx8_soc_init(void)
|
||||||
goto free_rev;
|
goto free_rev;
|
||||||
}
|
}
|
||||||
|
|
||||||
of_node_put(root);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
free_rev:
|
free_rev:
|
||||||
|
@ -145,7 +141,6 @@ free_rev:
|
||||||
kfree(soc_dev_attr->revision);
|
kfree(soc_dev_attr->revision);
|
||||||
free_soc:
|
free_soc:
|
||||||
kfree(soc_dev_attr);
|
kfree(soc_dev_attr);
|
||||||
of_node_put(root);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
device_initcall(imx8_soc_init);
|
device_initcall(imx8_soc_init);
|
||||||
|
|
Loading…
Add table
Reference in a new issue