aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/flatdevtree.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-05-31 00:57:05 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-05-31 00:57:05 -0400
commit5bc65793cbf8da0d35f19ef025dda22887e79e80 (patch)
tree8291998abd73055de6f487fafa174ee2a5d3afee /arch/powerpc/boot/flatdevtree.c
parent6edae708bf77e012d855a7e2c7766f211d234f4f (diff)
parent3f0a6766e0cc5a577805732e5adb50a585c58175 (diff)
[SCSI] Merge up to linux-2.6 head
Conflicts: drivers/scsi/jazz_esp.c Same changes made by both SCSI and SPARC trees: problem with UTF-8 conversion in the copyright. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
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,
891 struct ft_atom atom; 891 struct ft_atom atom;
892 void *node; 892 void *node;
893 char *p, *next; 893 char *p, *next;
894 int nextra, depth; 894 int nextra;
895 895
896 node = ft_node_ph2node(cxt, phandle); 896 node = ft_node_ph2node(cxt, phandle);
897 if (node == NULL) 897 if (node == NULL)
898 return -1; 898 return -1;
899 899
900 depth = 0; 900 next = ft_next(cxt, node, &atom);
901 p = node; 901 if (atom.tag != OF_DT_BEGIN_NODE)
902 /* phandle didn't point to a node */
903 return -1;
904 p = next;
902 905
903 while ((next = ft_next(cxt, p, &atom)) != NULL) { 906 while ((next = ft_next(cxt, p, &atom)) != NULL) {
904 switch (atom.tag) { 907 switch (atom.tag) {
905 case OF_DT_BEGIN_NODE: 908 case OF_DT_BEGIN_NODE: /* properties must go before subnodes */
906 ++depth;
907 break;
908 case OF_DT_END_NODE: 909 case OF_DT_END_NODE:
909 if (--depth > 0)
910 break;
911 /* haven't found the property, insert here */ 910 /* haven't found the property, insert here */
912 cxt->p = p; 911 cxt->p = p;
913 return ft_prop(cxt, propname, buf, buflen); 912 return ft_prop(cxt, propname, buf, buflen);
914 case OF_DT_PROP: 913 case OF_DT_PROP:
915 if ((depth != 1) || strcmp(atom.name, propname)) 914 if (strcmp(atom.name, propname))
916 break; 915 break;
917 /* found an existing property, overwrite it */ 916 /* found an existing property, overwrite it */
918 nextra = _ALIGN(buflen, 4) - _ALIGN(atom.size, 4); 917 nextra = _ALIGN(buflen, 4) - _ALIGN(atom.size, 4);