diff options
author | John Clarke <johnc@kirriwa.net> | 2018-11-02 12:46:22 +1100 |
---|---|---|
committer | John Clarke <johnc@kirriwa.net> | 2018-11-07 14:13:12 +1100 |
commit | aa7254d9cb173b43714013eef3769475948956f9 (patch) | |
tree | c2f76557751c5216acd1da7882455d06e7ea85b2 /tests/addr_size_cells.c | |
parent | da2b691ccf6863b2f5039d98e71f09d4244e5aa1 (diff) | |
download | dtc-aa7254d9cb173b43714013eef3769475948956f9.zip dtc-aa7254d9cb173b43714013eef3769475948956f9.tar.gz dtc-aa7254d9cb173b43714013eef3769475948956f9.tar.bz2 |
libfdt: return correct value if #size-cells property is not present
According to the device tree specification, the default value for
#size-cells is 1, but fdt_size_cells() was returning 2 if this property
was not present.
This patch also makes fdt_address_cells() and fdt_size_cells() conform
to the behaviour documented in libfdt.h. The defaults are only returned
if fdt_getprop() returns -FDT_ERR_NOTFOUND, otherwise the actual error
is returned.
Signed-off-by: John Clarke <johnc@kirriwa.net>
Diffstat (limited to 'tests/addr_size_cells.c')
-rw-r--r-- | tests/addr_size_cells.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/addr_size_cells.c b/tests/addr_size_cells.c index fcd9ff0..1b196ef 100644 --- a/tests/addr_size_cells.c +++ b/tests/addr_size_cells.c @@ -58,7 +58,7 @@ int main(int argc, char *argv[]) fdt = load_blob(argv[1]); check_node(fdt, "/", 2, 2); - check_node(fdt, "/identity-bus@0", 2, 2); + check_node(fdt, "/identity-bus@0", 2, 1); check_node(fdt, "/simple-bus@1000000", 2, 1); check_node(fdt, "/c0", -FDT_ERR_BADNCELLS, -FDT_ERR_BADNCELLS); check_node(fdt, "/c1", -FDT_ERR_BADNCELLS, -FDT_ERR_BADNCELLS); |