summaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-09-07 05:27:27 +0300
committerTom Rini <trini@konsulko.com>2022-09-30 05:43:43 +0300
commit5e96925ba5b934105a9c63f050b824f24a6dfb3d (patch)
treeaec2be17ce4278246bdf92af15f5eefc060628dc /drivers/core
parent92291652b5741647919770c29cae8a2aac56b2bf (diff)
downloadu-boot-5e96925ba5b934105a9c63f050b824f24a6dfb3d.tar.xz
dm: core: Complete phandle implementation using the other FDT
We need to be able to look up phandles in any FDT, not just the control FDT. Use the 'other' FDT to test this, with a helper function which gets this as an oftree that can then we used as needed. Add a few more tests and some comments at the top of the file, to explain what is going on. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/ofnode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 53db7b5ff0..2c4d521009 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -599,9 +599,9 @@ ofnode oftree_get_by_phandle(oftree tree, uint phandle)
if (of_live_active())
node = np_to_ofnode(of_find_node_by_phandle(tree.np, phandle));
else
- node.of_offset =
+ node = ofnode_from_tree_offset(tree,
fdt_node_offset_by_phandle(oftree_lookup_fdt(tree),
- phandle);
+ phandle));
return node;
}