mirror of
https://xff.cz/git/u-boot/
synced 2025-09-03 09:42:22 +02:00
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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user