Currently, fdt_get_base_address() returns 0 if the "reg" property is
missing. Since 0 is a valid value, it is not suitable for the error
handling. Return OF_BAD_ADDR instead.

Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---

 common/fdt_support.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index f31e9b0cc5a8..61c7b2096fbb 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -1546,7 +1546,7 @@ u64 fdt_get_base_address(const void *fdt, int node)
 
        prop = fdt_getprop(fdt, node, "reg", &size);
 
-       return prop ? fdt_translate_address(fdt, node, prop) : 0;
+       return prop ? fdt_translate_address(fdt, node, prop) : OF_BAD_ADDR;
 }
 
 /*
-- 
2.17.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to