]> git.dujemihanovic.xyz Git - u-boot.git/commit
core: read: fix dev_read_addr_size()
authorJohn Keeping <john@metanate.com>
Thu, 1 Jun 2023 14:11:19 +0000 (15:11 +0100)
committerSimon Glass <sjg@chromium.org>
Thu, 20 Jul 2023 20:10:57 +0000 (14:10 -0600)
commit77224320f05834344581f8b5d939907925876b3d
tree752af4557e379f54a7fd03ae1ef6aadfe86a2273
parent15a2865515fdd77d1edbc10e275b7b5a4914aa79
core: read: fix dev_read_addr_size()

The behaviour of dev_read_addr_size() is surprising as it does not
handle #address-cells and #size-cells but instead hardcodes the values
based on sizeof(fdt_addr_t).

This is different from dev_read_addr_size_index() and
dev_read_addr_size_name() both of which do read the cell sizes from the
device tree.

Since dev_read_addr_size() is only used by a single driver and this
driver is broken when CONFIG_FDT_64BIT does not match the address size
in the device tree, fix the function to behave like all of the other
similarly named functions.  Drop the property name argument as the only
caller passes "reg" and this is the expected property name matching the
other similarly named functions.

Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> # chromebook_jerry
Tested-by: Simon Glass <sjg@chromium.org> # chromebook_bob
drivers/core/read.c
drivers/reset/reset-rockchip.c
include/dm/read.h