Commit f93ea234 authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by Linus Torvalds

[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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 44e4665c
...@@ -626,8 +626,18 @@ inspect_node(phandle node, struct device_node *dad, ...@@ -626,8 +626,18 @@ inspect_node(phandle node, struct device_node *dad,
l = call_prom("package-to-path", 3, 1, node, l = call_prom("package-to-path", 3, 1, node,
mem_start, mem_end - mem_start); mem_start, mem_end - mem_start);
if (l >= 0) { if (l >= 0) {
char *p, *ep;
np->full_name = PTRUNRELOC((char *) mem_start); np->full_name = PTRUNRELOC((char *) mem_start);
*(char *)(mem_start + l) = 0; *(char *)(mem_start + l) = 0;
/* Fixup an Apple bug where they have bogus \0 chars in the
* middle of the path in some properties
*/
for (p = (char *)mem_start, ep = p + l; p < ep; p++)
if ((*p) == '\0') {
memmove(p, p+1, ep - p);
ep--;
}
mem_start = ALIGNUL(mem_start + l + 1); mem_start = ALIGNUL(mem_start + l + 1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment