summaryrefslogtreecommitdiff
path: root/checks.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2012-08-07 22:50:15 -0600
committerJon Loeliger <jdl@jdl.com>2012-09-06 07:51:43 -0500
commit45013d86197fea96810a7ae1b920d22b4c887688 (patch)
tree0048099d9141732edb7ab13d84720ef938fec24e /checks.c
parent8716901d2215a314504b7df6282aedfcf89da1ea (diff)
downloaddtc-45013d86197fea96810a7ae1b920d22b4c887688.tar.gz
dtc: Add ability to delete nodes and properties
dtc currently allows the contents of properties to be changed, and the contents of nodes to be added to. There are situations where removing properties or nodes may be useful. This change implements the following syntax to do that: / { /delete-property/ propname; /delete-node/ nodename; }; or: /delete-node/ &noderef; Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'checks.c')
-rw-r--r--checks.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/checks.c b/checks.c
index 9061237..ee96a25 100644
--- a/checks.c
+++ b/checks.c
@@ -256,11 +256,15 @@ static void check_duplicate_property_names(struct check *c, struct node *dt,
{
struct property *prop, *prop2;
- for_each_property(node, prop)
- for (prop2 = prop->next; prop2; prop2 = prop2->next)
+ for_each_property(node, prop) {
+ for (prop2 = prop->next; prop2; prop2 = prop2->next) {
+ if (prop2->deleted)
+ continue;
if (streq(prop->name, prop2->name))
FAIL(c, "Duplicate property name %s in %s",
prop->name, node->fullpath);
+ }
+ }
}
NODE_ERROR(duplicate_property_names, NULL);