dm: core: Pass a root node to of_find_node_by_phandle()
This function currently assumes that the control FDT is used. Update it
to allow a root node to be passed, so it can work with any tree.
Also add a comment to ofnode_get_by_phandle() so that its purpose is
clear.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 42f3c09..b241be3 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -391,7 +391,7 @@
ofnode node;
if (of_live_active())
- node = np_to_ofnode(of_find_node_by_phandle(phandle));
+ node = np_to_ofnode(of_find_node_by_phandle(NULL, phandle));
else
node.of_offset = fdt_node_offset_by_phandle(gd->fdt_blob,
phandle);