aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/boot/flatdevtree.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-18 08:26:28 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-18 08:26:28 -0700
commit347b4599dd6ffef27e18c227532d1ec66556000b (patch)
treedf37f2645e7e13a4203368006ae8fcdf3b86ca78 /arch/powerpc/boot/flatdevtree.c
parent939e3428066962b7c5966d8f9648058e644f5395 (diff)
parentccd308f09a6636d86dbe62bab892b96711feee67 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (32 commits) [POWERPC] Remove build warnings in windfarm_core [POWERPC] Pass per-file CFLAGs for platform specific op codes [POWERPC] Correct #endif comment [POWERPC] Fix ppc_rtas_progress_show() [POWERPC] Fix sed command lines for zlib source construction [POWERPC] Specify GNUTARGET on $(AR) invocations [POWERPC] Make sure device node type/name is not NULL on hot-added nodes [POWERPC] Small fixes for the Ebony device tree [POWERPC] Fix warning on UP [POWERPC] cell_defconfig: Disable cpufreq and pmi [POWERPC] Fix IO space on PCI buses created from of_platform [POWERPC] Add spinlock to request_phb_iospace() [POWERPC] Fix make rules for treeImage.initrd [POWERPC] Remove warning in mpic.c [POWERPC] Update pasemi_defconfig [POWERPC] pasemi: CONFIG_GENERIC_TBSYNC no longer needed [POWERPC] Update iseries_defconfig [POWERPC] Wire up some more syscalls [POWERPC] Fix bug adding properties with flatdevtree.c's ft_set_prop() [POWERPC] Remove fixup_bigphys_addr() for arch/powerpc to avoid link error ...
Diffstat (limited to 'arch/powerpc/boot/flatdevtree.c')
-rw-r--r--arch/powerpc/boot/flatdevtree.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/powerpc/boot/flatdevtree.c b/arch/powerpc/boot/flatdevtree.c
index d00fbd92a458..b732644788db 100644
--- a/arch/powerpc/boot/flatdevtree.c
+++ b/arch/powerpc/boot/flatdevtree.c
@@ -891,28 +891,27 @@ int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
struct ft_atom atom;
void *node;
char *p, *next;
- int nextra, depth;
+ int nextra;
node = ft_node_ph2node(cxt, phandle);
if (node == NULL)
return -1;
- depth = 0;
- p = node;
+ next = ft_next(cxt, node, &atom);
+ if (atom.tag != OF_DT_BEGIN_NODE)
+ /* phandle didn't point to a node */
+ return -1;
+ p = next;
while ((next = ft_next(cxt, p, &atom)) != NULL) {
switch (atom.tag) {
- case OF_DT_BEGIN_NODE:
- ++depth;
- break;
+ case OF_DT_BEGIN_NODE: /* properties must go before subnodes */
case OF_DT_END_NODE:
- if (--depth > 0)
- break;
/* haven't found the property, insert here */
cxt->p = p;
return ft_prop(cxt, propname, buf, buflen);
case OF_DT_PROP:
- if ((depth != 1) || strcmp(atom.name, propname))
+ if (strcmp(atom.name, propname))
break;
/* found an existing property, overwrite it */
nextra = _ALIGN(buflen, 4) - _ALIGN(atom.size, 4);