summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-04-24 23:30:59 -0600
committerTom Rini <trini@konsulko.com>2022-04-25 10:00:03 -0400
commit6aa4fe39122a85ce1ef559139518fa5042406186 (patch)
treeeaf85bd156690a2fd2ab9a77e92ce31c53f2b35a /test
parent8565efd509236dc7d4e766de39edae2cefb10057 (diff)
dm: core: Rename and fix uclass_get_by_name_len()
It seems that namelen is more common in U-Boot. Rename this function to fit in better. Also fix a bug where it breaks the operation of uclass_get_by_name() and add a test. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reported-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'test')
-rw-r--r--test/dm/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/dm/core.c b/test/dm/core.c
index 0ce0b3c4a2e..2c73ecf54a0 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -1161,6 +1161,8 @@ static int dm_test_uclass_names(struct unit_test_state *uts)
ut_asserteq_str("test", uclass_get_name(UCLASS_TEST));
ut_asserteq(UCLASS_TEST, uclass_get_by_name("test"));
+ ut_asserteq(UCLASS_SPI, uclass_get_by_name("spi"));
+
return 0;
}
DM_TEST(dm_test_uclass_names, UT_TESTF_SCAN_PDATA);