diff options
author | Scott Wood <scottwood@freescale.com> | 2007-03-12 20:41:59 (GMT) |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-03-16 04:49:15 (GMT) |
commit | 86a1b63349bb2cbed6c2cbf8f9e9de9259a404df (patch) | |
tree | a4fbdff5b1fcf7b0cd63f01e378644db4bc0a410 /arch/powerpc/boot/flatdevtree.c | |
parent | 8941c0c495e8765206ec1017b1e069ce41bf6e8f (diff) | |
download | linux-fsl-qoriq-86a1b63349bb2cbed6c2cbf8f9e9de9259a404df.tar.xz |
[POWERPC] bootwrapper: Make ft_create_node() pay attention to the parent parameter.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot/flatdevtree.c')
-rw-r--r-- | arch/powerpc/boot/flatdevtree.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/powerpc/boot/flatdevtree.c b/arch/powerpc/boot/flatdevtree.c index f6e37c2..d00fbd9 100644 --- a/arch/powerpc/boot/flatdevtree.c +++ b/arch/powerpc/boot/flatdevtree.c @@ -961,19 +961,26 @@ int ft_del_prop(struct ft_cxt *cxt, const void *phandle, const char *propname) return -1; } -void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *path) +void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name) { struct ft_atom atom; char *p, *next; int depth = 0; - p = ft_root_node(cxt); + if (parent) { + p = ft_node_ph2node(cxt, parent); + if (!p) + return NULL; + } else { + p = ft_root_node(cxt); + } + while ((next = ft_next(cxt, p, &atom)) != NULL) { switch (atom.tag) { case OF_DT_BEGIN_NODE: ++depth; - if (depth == 1 && strcmp(atom.name, path) == 0) - /* duplicate node path, return error */ + if (depth == 1 && strcmp(atom.name, name) == 0) + /* duplicate node name, return error */ return NULL; break; case OF_DT_END_NODE: @@ -982,7 +989,7 @@ void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *path) break; /* end of node, insert here */ cxt->p = p; - ft_begin_node(cxt, path); + ft_begin_node(cxt, name); ft_end_node(cxt); return p; } |