ofnode: Add missing address translation into ofnode_get_addr_size()
authorMarek Vasut <marek.vasut@gmail.com>
Mon, 1 Oct 2018 10:37:20 +0000 (12:37 +0200)
committerSimon Glass <sjg@chromium.org>
Mon, 8 Oct 2018 13:34:34 +0000 (07:34 -0600)
Of CONFIG_OF_TRANSLATE is enabled, this function still returns
untranslated bogus results. Add the missing translation.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/core/ofnode.c

index beb72963b8b8464b697baa7da421f09c3a0b0124..fbc67516fc3b3e2a87b7536e8990e00be3265988 100644 (file)
@@ -543,7 +543,11 @@ fdt_addr_t ofnode_get_addr_size(ofnode node, const char *property,
                na = of_n_addr_cells(np);
                ns = of_n_size_cells(np);
                *sizep = of_read_number(prop + na, ns);
-               return of_read_number(prop, na);
+
+               if (IS_ENABLED(CONFIG_OF_TRANSLATE) && ns > 0)
+                       return of_translate_address(np, prop);
+               else
+                       return of_read_number(prop, na);
        } else {
                return fdtdec_get_addr_size(gd->fdt_blob,
                                            ofnode_to_offset(node), property,