Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

of: unittest: Add a test case for of_find_node_opts_by_path() with alias+path+options

To test of_find_node_opts_by_path() take @path argument with pattern:

"alias-name/node-name-1/.../node-name-N:options", for example:
"testcase-alias/phandle-tests/consumer-a:testaliasoption"

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20241216-of_core_fix-v2-2-e69b8f60da63@quicinc.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>

authored by

Zijun Hu and committed by
Rob Herring (Arm)
c1b4b91a d1ad6367

+9
+9
drivers/of/unittest.c
··· 161 161 "option alias path test, subcase #1 failed\n"); 162 162 of_node_put(np); 163 163 164 + np = of_find_node_opts_by_path("testcase-alias/phandle-tests/consumer-a:testaliasoption", 165 + &options); 166 + name = kasprintf(GFP_KERNEL, "%pOF", np); 167 + unittest(np && name && !strcmp("/testcase-data/phandle-tests/consumer-a", name) && 168 + !strcmp("testaliasoption", options), 169 + "option alias path test, subcase #2 failed\n"); 170 + of_node_put(np); 171 + kfree(name); 172 + 164 173 np = of_find_node_opts_by_path("testcase-alias:testaliasoption", NULL); 165 174 unittest(np, "NULL option alias path test failed\n"); 166 175 of_node_put(np);