Revert "fdt: translate address if #size-cells = <0>"
This reverts commit d64b9cdcd4.
As pointed by [1] and [2], the reverted patch made every DT 'reg'
property translatable. What the patch was trying to fix was fixed in a
different way from previously submitted patches which instead of
correcting the generic address translation function fixed the issue with
appropriate platform code.
[1] https://patchwork.ozlabs.org/project/uboot/patch/1614324949-61314-1-git-send-email-bmeng.cn@gmail.com/
[2] https://lore.kernel.org/linux-clk/20210402192054.7934-1-dariobin@libero.it/T/
Signed-off-by: Dario Binacchi <dariobin@libero.it>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
committed by
Lokesh Vutla
parent
5a6caf916c
commit
a47abd7bf4
@@ -319,8 +319,7 @@ fdt_addr_t ofnode_get_addr_size_index(ofnode node, int index, fdt_size_t *size)
|
||||
|
||||
ns = of_n_size_cells(ofnode_to_np(node));
|
||||
|
||||
if (IS_ENABLED(CONFIG_OF_TRANSLATE) &&
|
||||
(ns > 0 || gd_size_cells_0())) {
|
||||
if (IS_ENABLED(CONFIG_OF_TRANSLATE) && ns > 0) {
|
||||
return of_translate_address(ofnode_to_np(node), prop_val);
|
||||
} else {
|
||||
na = of_n_addr_cells(ofnode_to_np(node));
|
||||
@@ -703,10 +702,8 @@ fdt_addr_t ofnode_get_addr_size(ofnode node, const char *property,
|
||||
ns = of_n_size_cells(np);
|
||||
*sizep = of_read_number(prop + na, ns);
|
||||
|
||||
if (CONFIG_IS_ENABLED(OF_TRANSLATE) &&
|
||||
(ns > 0 || gd_size_cells_0())) {
|
||||
if (CONFIG_IS_ENABLED(OF_TRANSLATE) && ns > 0)
|
||||
return of_translate_address(np, prop);
|
||||
}
|
||||
else
|
||||
return of_read_number(prop, na);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user