From: Marek Vasut Date: Mon, 1 Oct 2018 10:37:20 +0000 (+0200) Subject: ofnode: Add missing address translation into ofnode_get_addr_size() X-Git-Tag: v2018.11-rc2~7^2~58 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a6a45cd32539dcc8d91a8c42d04f378598cfedf6;p=oweals%2Fu-boot.git ofnode: Add missing address translation into ofnode_get_addr_size() Of CONFIG_OF_TRANSLATE is enabled, this function still returns untranslated bogus results. Add the missing translation. Signed-off-by: Marek Vasut Cc: Simon Glass Cc: Tom Rini Reviewed-by: Simon Glass --- diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c index beb72963b8..fbc67516fc 100644 --- a/drivers/core/ofnode.c +++ b/drivers/core/ofnode.c @@ -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,