]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
riscv: Use optimized version of fdtdec_get_addr_size_no_parent
authorAtish Patra <atish.patra@wdc.com>
Wed, 24 Jun 2020 21:56:15 +0000 (14:56 -0700)
committerAndes <uboot@andestech.com>
Fri, 3 Jul 2020 07:09:00 +0000 (15:09 +0800)
fdtdec_get_addr_size_no_parent is not an optimized version if parent
node is already available with the caller.

Use fdtdec_get_addr_size_auto_parent to read the "reg" property

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
arch/riscv/lib/fdt_fixup.c

index bd4a3c993a4ca9859a1008bc6345ea236381cbf4..c7cb74e08a844f05e85049fdb9718465365aa71f 100644 (file)
@@ -56,9 +56,9 @@ int riscv_fdt_copy_resv_mem_node(const void *src, void *dst)
        fdt_for_each_subnode(node, src, offset) {
                name = fdt_get_name(src, node, NULL);
 
-               addr = fdtdec_get_addr_size_auto_noparent(src, node,
-                                                         "reg", 0, &size,
-                                                         false);
+               addr = fdtdec_get_addr_size_auto_parent(src, offset, node,
+                                                       "reg", 0, &size,
+                                                       false);
                if (addr == FDT_ADDR_T_NONE) {
                        debug("failed to read address/size for %s\n", name);
                        continue;