aboutsummaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorSimon Glass2020-11-28 17:50:07 -0700
committerSimon Glass2020-12-13 07:58:18 -0700
commitd0c20ce6bcb9af3d70ed6ada618607ca1099e811 (patch)
treebc04f32a35dfd54b571512fa792085130d228ed4 /drivers/core
parente80be7493412e0facbbf81f709dc44740e975dea (diff)
dm: core: Add an ofnode function to get the devicetree root
This is needed in at least one place. Avoid the conditional code in root.c by adding this inline function. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/root.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 5f10d7a39c7..9ee65504e6e 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -147,12 +147,8 @@ int dm_init(bool of_live)
ret = device_bind_by_name(NULL, false, &root_info, &DM_ROOT_NON_CONST);
if (ret)
return ret;
-#if CONFIG_IS_ENABLED(OF_CONTROL)
- if (CONFIG_IS_ENABLED(OF_LIVE) && of_live)
- DM_ROOT_NON_CONST->node = np_to_ofnode(gd_of_root());
- else
- DM_ROOT_NON_CONST->node = offset_to_ofnode(0);
-#endif
+ if (CONFIG_IS_ENABLED(OF_CONTROL))
+ DM_ROOT_NON_CONST->node = ofnode_root();
ret = device_probe(DM_ROOT_NON_CONST);
if (ret)
return ret;