aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2015-03-17 12:30:32 -0700
committerAlex Shi <alex.shi@linaro.org>2015-12-16 15:29:30 +0800
commit1e89a5c2cbbb455f73946372782f19b84f4d80c9 (patch)
treeba06cd395e9764565668468bc344c6644ee93054
parent479c55cc1950b1dca1cf67a736d33e7355029d21 (diff)
downloadlinux-linaro-stable-1e89a5c2cbbb455f73946372782f19b84f4d80c9.tar.gz
of: unittest: Add option string test case with longer path
There were regressions seen with commit 106937e8ccdc ("of: fix handling of '/' in options for of_find_node_by_path()"), where we couldn't handle extra '/' before the ':'. Let's test for this now. Confirmed that this test fails without the previous patch and passes when patched. All other tests pass. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Rob Herring <robh@kernel.org> (cherry picked from commit 5ca1b0dd016701f67994414a2af50dec6efcf103) Signed-off-by: Alex Shi <alex.shi@linaro.org>
-rw-r--r--drivers/of/unittest.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 4c2ee3f86e42..e5fa3e91f82f 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -94,6 +94,11 @@ static void __init of_selftest_find_node_by_name(void)
"option path test, subcase #1 failed\n");
of_node_put(np);
+ np = of_find_node_opts_by_path("/testcase-data/testcase-device1:test/option", &options);
+ selftest(np && !strcmp("test/option", options),
+ "option path test, subcase #2 failed\n");
+ of_node_put(np);
+
np = of_find_node_opts_by_path("/testcase-data:testoption", NULL);
selftest(np, "NULL option path test failed\n");
of_node_put(np);