diff options
author | Simon Glass <sjg@chromium.org> | 2021-07-29 04:23:11 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-08-01 18:05:24 +0300 |
commit | eec44c7218a3c3ce924a282cc46a59e83feb9de1 (patch) | |
tree | 2508a115df4604adc9395b4f72e8ec3ec8fff90f /test/dm | |
parent | ca04494d76bf1152cd9ab1f67af5101c86e0824f (diff) | |
download | u-boot-eec44c7218a3c3ce924a282cc46a59e83feb9de1.tar.xz |
dtoc: Support widening a bool value
At present if we see 'ranges' property (with no value) we assume it is a
boolean, as per the devicetree spec.
But another node may define 'ranges' with a value, forcing us to widen it
to an int array. At present this is not supported and causes an error.
Fix this and add some test cases.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'test/dm')
-rw-r--r-- | test/dm/of_platdata.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/dm/of_platdata.c b/test/dm/of_platdata.c index e3fa01afdd..0463cf0b43 100644 --- a/test/dm/of_platdata.c +++ b/test/dm/of_platdata.c @@ -40,6 +40,8 @@ static int dm_test_of_plat_props(struct unit_test_state *uts) ut_asserteq(3, plat->intarray[1]); ut_asserteq(4, plat->intarray[2]); ut_asserteq(5, plat->byteval); + ut_asserteq(1, ARRAY_SIZE(plat->maybe_empty_int)); + ut_asserteq(0, plat->maybe_empty_int[0]); ut_asserteq(3, ARRAY_SIZE(plat->bytearray)); ut_asserteq(6, plat->bytearray[0]); ut_asserteq(0, plat->bytearray[1]); @@ -78,6 +80,7 @@ static int dm_test_of_plat_props(struct unit_test_state *uts) ut_asserteq_str("one", plat->stringarray[0]); ut_asserteq_str("", plat->stringarray[1]); ut_asserteq_str("", plat->stringarray[2]); + ut_asserteq(1, plat->maybe_empty_int[0]); ut_assertok(uclass_next_device_err(&dev)); plat = dev_get_plat(dev); |