]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
test: create dedicated fdt node for ofnode_for_each_prop test
authorDzmitry Sankouski <dsankouski@gmail.com>
Sun, 22 Jan 2023 15:21:23 +0000 (18:21 +0300)
committerTom Rini <trini@konsulko.com>
Fri, 10 Feb 2023 17:50:01 +0000 (12:50 -0500)
Property count may change in /buttons node, if more button tests added,
and this will break ofnode_for_each_prop.
Add separate node for mentioned test.

Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/sandbox/dts/test.dts
test/dm/ofnode.c

index f98f0152ee849be33b3be9bc8d6a08f15b694910..716e8c718565a409fe4dbbc079fd6700e7c68c98 100644 (file)
                };
        };
 
+       ofnode-foreach {
+               compatible = "foreach";
+
+               first {
+                       prop1 = <1>;
+                       prop2 = <2>;
+               };
+
+               second {
+                       prop1 = <1>;
+                       prop2 = <2>;
+               };
+       };
+
        osd {
                compatible = "sandbox,sandbox_osd";
        };
index 8077affabb71746359a0ed961bbc64d40fd79189..473a8cef5780a0a82c98fc31c85c72353bac368e 100644 (file)
@@ -1046,7 +1046,7 @@ static int dm_test_ofnode_for_each_prop(struct unit_test_state *uts)
        struct ofprop prop;
        int count;
 
-       node = ofnode_path("/buttons");
+       node = ofnode_path("/ofnode-foreach");
        count = 0;
 
        /* we expect "compatible" for each node */