summaryrefslogtreecommitdiff
path: root/fstree.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2010-02-24 18:22:17 +1100
committerJon Loeliger <jdl@jdl.com>2010-02-24 08:48:51 -0600
commit05898c67c15d73fe50bd87fc939bd9ee6a4275ce (patch)
treea8ea4e24ccdd0e8a21dc028e2b55a1226d6d3bc2 /fstree.c
parent49c2da308534a4bffb67d53b5a7f8e5f05c305b9 (diff)
downloaddtc-05898c67c15d73fe50bd87fc939bd9ee6a4275ce.tar.gz
dtc: Allow multiple labels on nodes and properties
At present, both the grammar and our internal data structures mean that there can be only one label on a node or property. This is a fairly arbitrary constraint, given that any number of value labels can appear at the same point, and that in C you can have any number of labels on the same statement. This is pretty much a non-issue now, but it may become important with some of the extensions that Grant and I have in mind. It's not that hard to change, so this patch does so, allowing an arbitrary number of labels on any given node or property. As usual a testcase is added too. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'fstree.c')
-rw-r--r--fstree.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fstree.c b/fstree.c
index d43343a..ba0da9d 100644
--- a/fstree.c
+++ b/fstree.c
@@ -60,8 +60,7 @@ static struct node *read_fstree(const char *dirname)
} else {
prop = build_property(xstrdup(de->d_name),
data_copy_file(pfile,
- st.st_size),
- NULL);
+ st.st_size));
add_property(tree, prop);
fclose(pfile);
}
@@ -69,8 +68,7 @@ static struct node *read_fstree(const char *dirname)
struct node *newchild;
newchild = read_fstree(tmpnam);
- newchild = name_node(newchild, xstrdup(de->d_name),
- NULL);
+ newchild = name_node(newchild, xstrdup(de->d_name));
add_child(tree, newchild);
}
@@ -85,7 +83,7 @@ struct boot_info *dt_from_fs(const char *dirname)
struct node *tree;
tree = read_fstree(dirname);
- tree = name_node(tree, "", NULL);
+ tree = name_node(tree, "");
return build_boot_info(NULL, tree, guess_boot_cpuid(tree));
}