summaryrefslogtreecommitdiff
path: root/drivers/core/ofnode.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-08-23 16:06:38 -0400
committerTom Rini <trini@konsulko.com>2020-08-23 16:06:38 -0400
commitd584648dad691caec3ecc7777dbfa3f1936878e5 (patch)
treeee787f8204c917526859da55840f6f159a00b8ba /drivers/core/ofnode.c
parentc84341f5acd6140f361300f02b354a7238f95b72 (diff)
parenta4020350289c520e896fd6180e510be557ed3bf9 (diff)
Merge tag 'dm-pull-22aug20' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
replace devfdt_get_addr_ptr() with dev_read_addr_ptr() binman fixes for portage various minor fixes 'bind' command improvements
Diffstat (limited to 'drivers/core/ofnode.c')
-rw-r--r--drivers/core/ofnode.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index c37afa1fe6..d02d8d33fe 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -776,18 +776,26 @@ int ofnode_read_pci_vendev(ofnode node, u16 *vendor, u16 *device)
int ofnode_read_addr_cells(ofnode node)
{
- if (ofnode_is_np(node))
+ if (ofnode_is_np(node)) {
return of_n_addr_cells(ofnode_to_np(node));
- else /* NOTE: this call should walk up the parent stack */
- return fdt_address_cells(gd->fdt_blob, ofnode_to_offset(node));
+ } else {
+ int parent = fdt_parent_offset(gd->fdt_blob,
+ ofnode_to_offset(node));
+
+ return fdt_address_cells(gd->fdt_blob, parent);
+ }
}
int ofnode_read_size_cells(ofnode node)
{
- if (ofnode_is_np(node))
+ if (ofnode_is_np(node)) {
return of_n_size_cells(ofnode_to_np(node));
- else /* NOTE: this call should walk up the parent stack */
- return fdt_size_cells(gd->fdt_blob, ofnode_to_offset(node));
+ } else {
+ int parent = fdt_parent_offset(gd->fdt_blob,
+ ofnode_to_offset(node));
+
+ return fdt_size_cells(gd->fdt_blob, parent);
+ }
}
int ofnode_read_simple_addr_cells(ofnode node)