summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-08-07 16:24:01 +0300
committerSimon Glass <sjg@chromium.org>2021-09-25 18:46:15 +0300
commit7de8bd03c37af6120cf5bba9bf1adb492ed56868 (patch)
tree03d977384b888feedf77e0d274f7682d732d6be9 /test
parentbb38d77ca779cc8bdad3d4ceb6cecc687f4987c2 (diff)
downloadu-boot-7de8bd03c37af6120cf5bba9bf1adb492ed56868.tar.xz
treewide: fdt: Move fdt_get_config_... to ofnode_conf_read...
The current API is outdated as it requires a devicetree pointer. Move these functions to use the ofnode API and update this globally. Add some tests while we are here. Correct the call in exynos_dsim_config_parse_dt() which is obviously wrong. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/dm/ofnode.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/dm/ofnode.c b/test/dm/ofnode.c
index 44e51de085..49efabe871 100644
--- a/test/dm/ofnode.c
+++ b/test/dm/ofnode.c
@@ -318,3 +318,18 @@ static int dm_test_ofnode_get_path(struct unit_test_state *uts)
return 0;
}
DM_TEST(dm_test_ofnode_get_path, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+
+static int dm_test_ofnode_conf(struct unit_test_state *uts)
+{
+ ut_assert(!ofnode_conf_read_bool("missing"));
+ ut_assert(ofnode_conf_read_bool("testing-bool"));
+
+ ut_asserteq(123, ofnode_conf_read_int("testing-int", 0));
+ ut_asserteq(6, ofnode_conf_read_int("missing", 6));
+
+ ut_assertnull(ofnode_conf_read_str("missing"));
+ ut_asserteq_str("testing", ofnode_conf_read_str("testing-str"));
+
+ return 0;
+}
+DM_TEST(dm_test_ofnode_conf, 0);