aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Rowand <frank.rowand@sony.com>2017-10-17 19:36:28 -0400
committerRob Herring <robh@kernel.org>2017-10-17 21:47:22 -0400
commit6d0f5470dbdeb7f9b1e20fc9409bf07fab1b5ac5 (patch)
tree6bf7e5ef0c213f6d0fd4728a9fc8eea1fb29f24a
parent87f242c119c403e8b948c8b95eca4ab6212fd1a9 (diff)
of: overlay: loosen overly strict phandle clash check
When an overlay contains a node that already exists in the live device tree, the overlay node is not allowed to change the phandle of the existing node. The existing check refused to allow an overlay node to set the node phandle even when the existing node did not have a phandle. Relax the check to allow an overlay node to set the phandle value if the existing node does not have a phandle. Signed-off-by: Frank Rowand <frank.rowand@sony.com> Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r--drivers/of/overlay.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index 4cdee169a5ab..791753321ed2 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -311,10 +311,10 @@ static int add_changeset_node(struct overlay_changeset *ovcs,
311 return build_changeset_next_level(ovcs, tchild, node, 0); 311 return build_changeset_next_level(ovcs, tchild, node, 0);
312 } 312 }
313 313
314 if (node->phandle) 314 if (node->phandle && tchild->phandle)
315 return -EINVAL; 315 ret = -EINVAL;
316 316 else
317 ret = build_changeset_next_level(ovcs, tchild, node, 0); 317 ret = build_changeset_next_level(ovcs, tchild, node, 0);
318 of_node_put(tchild); 318 of_node_put(tchild);
319 319
320 return ret; 320 return ret;