mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
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>
This commit is contained in:
parent
da2b691ccf
commit
aa7254d9cb
4 changed files with 16 additions and 6 deletions
|
@ -57,6 +57,6 @@ int main(int argc, char *argv[])
|
|||
test_init(argc, argv);
|
||||
fdt = load_blob(argv[1]);
|
||||
|
||||
check_node(fdt, "/", 2, 2);
|
||||
check_node(fdt, "/", 2, 1);
|
||||
PASS();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue