of: unittest: remove report of expected error
authorFrank Rowand <frank.rowand@sony.com>
Thu, 24 Jan 2019 23:22:13 +0000 (15:22 -0800)
committerRob Herring <robh@kernel.org>
Wed, 13 Feb 2019 18:12:53 +0000 (12:12 -0600)
update_node_properties() reports an error when the test data contains
a node (such as "/aliases") that already exists in the base devicetree.
The error is caused by of_fdt_unflatten_tree() autogenerating the
"name" property, thus both the existing node and the new node will
have a property with the same name.  Suppress reporting the known
error.

Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/unittest.c

index 8442738..3249fe2 100644 (file)
@@ -1116,9 +1116,12 @@ static void update_node_properties(struct device_node *np,
        for (prop = np->properties; prop != NULL; prop = save_next) {
                save_next = prop->next;
                ret = of_add_property(dup, prop);
-               if (ret)
+               if (ret) {
+                       if (ret == -EEXIST && !strcmp(prop->name, "name"))
+                               continue;
                        pr_err("unittest internal error: unable to add testdata property %pOF/%s",
                               np, prop->name);
+               }
        }
 }