]> asedeno.scripts.mit.edu Git - linux.git/commit
of: overlay: check prevents multiple fragments add or delete same node
authorFrank Rowand <frank.rowand@sony.com>
Fri, 5 Oct 2018 03:35:14 +0000 (20:35 -0700)
committerFrank Rowand <frank.rowand@sony.com>
Fri, 9 Nov 2018 06:11:57 +0000 (22:11 -0800)
commitc168263b5a10d2434ad5051be8dda47baa34a98e
tree002503e24c65a82154652fc551e8a7a59d0680d2
parenta68238a19c3b24e43fd2327d102bcea0ccceb7d0
of: overlay: check prevents multiple fragments add or delete same node

Multiple overlay fragments adding or deleting the same node is not
supported.  Replace code comment of such, with check to detect the
attempt and fail the overlay apply.

Devicetree unittest where multiple fragments added the same node was
added in the previous patch in the series.  After applying this patch
the unittest messages will no longer include:

   Duplicate name in motor-1, renamed to "controller#1"
   OF: overlay: of_overlay_apply() err=0
   ### dt-test ### of_overlay_fdt_apply() expected -22, ret=0, overlay_bad_add_dup_node
   ### dt-test ### FAIL of_unittest_overlay_high_level():2419 Adding overlay 'overlay_bad_add_dup_node' failed

   ...

   ### dt-test ### end of unittest - 210 passed, 1 failed

but will instead include:

   OF: overlay: ERROR: multiple overlay fragments add and/or delete node /testcase-data-2/substation@100/motor-1/controller

   ...

   ### dt-test ### end of unittest - 211 passed, 0 failed

Tested-by: Alan Tull <atull@kernel.org>
Signed-off-by: Frank Rowand <frank.rowand@sony.com>
drivers/of/overlay.c