aboutsummaryrefslogtreecommitdiff
path: root/dtc.h
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2010-02-23 19:56:41 +1100
committerJon Loeliger <jdl@jdl.com>2010-02-23 09:04:48 -0600
commit329055dbbc3c09e21386ceae788256991f4c8aec (patch)
tree92d2c0fee03699a262080183cc2f4c756972a24e /dtc.h
parent15ad6d862ec7f66dc00783798705a8db1c5d9aca (diff)
downloaddtc-329055dbbc3c09e21386ceae788256991f4c8aec.tar.gz
Disallow re-use of the same label within a dts file
Currently, nothing will stop you from re-using the same label string multiple times in a dts, e.g.: / { samelabel: prop1 = "foo"; samelabel: prop2 = "bar"; }; or / { samelabel: prop1 = "foo"; samelabel: subnode { }; }; When using node references by label, this could lead to confusing results (with no warning), and in -Oasm mode will result in output which the assembler will complain about (since it too will have duplicate labels). This patch, therefore, adds code to checks.c to give errors if you attempt to re-use the same label. It treats all labels (node, property, and value) as residing in the same namespace, since the assembler will treat them so for -Oasm mode. Testcases for the new code are also added. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'dtc.h')
-rw-r--r--dtc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/dtc.h b/dtc.h
index 13136e4..5367198 100644
--- a/dtc.h
+++ b/dtc.h
@@ -171,6 +171,10 @@ void add_child(struct node *parent, struct node *child);
const char *get_unitname(struct node *node);
struct property *get_property(struct node *node, const char *propname);
cell_t propval_cell(struct property *prop);
+struct property *get_property_by_label(struct node *tree, const char *label,
+ struct node **node);
+struct marker *get_marker_label(struct node *tree, const char *label,
+ struct node **node, struct property **prop);
struct node *get_subnode(struct node *node, const char *nodename);
struct node *get_node_by_path(struct node *tree, const char *path);
struct node *get_node_by_label(struct node *tree, const char *label);