[PATCH] ppc32: Apple device-tree bug fix

This is the ppc32 patch equivalent to the just posted ppc64 one working
around a bug in Apple device-trees regarding the "cpus" nodes.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Benjamin Herrenschmidt and committed by
Linus Torvalds
f93ea234 44e4665c

+10
+10
arch/ppc/syslib/prom_init.c
··· 626 l = call_prom("package-to-path", 3, 1, node, 627 mem_start, mem_end - mem_start); 628 if (l >= 0) { 629 np->full_name = PTRUNRELOC((char *) mem_start); 630 *(char *)(mem_start + l) = 0; 631 mem_start = ALIGNUL(mem_start + l + 1); 632 } 633
··· 626 l = call_prom("package-to-path", 3, 1, node, 627 mem_start, mem_end - mem_start); 628 if (l >= 0) { 629 + char *p, *ep; 630 + 631 np->full_name = PTRUNRELOC((char *) mem_start); 632 *(char *)(mem_start + l) = 0; 633 + /* Fixup an Apple bug where they have bogus \0 chars in the 634 + * middle of the path in some properties 635 + */ 636 + for (p = (char *)mem_start, ep = p + l; p < ep; p++) 637 + if ((*p) == '\0') { 638 + memmove(p, p+1, ep - p); 639 + ep--; 640 + } 641 mem_start = ALIGNUL(mem_start + l + 1); 642 } 643