diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/of/fdt.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 18d282fefe58..b51f797d9d9d 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
@@ -310,10 +310,19 @@ unsigned long __init unflatten_dt_node(unsigned long mem, | |||
310 | pp = unflatten_dt_alloc(&mem, sizeof(struct property), | 310 | pp = unflatten_dt_alloc(&mem, sizeof(struct property), |
311 | __alignof__(struct property)); | 311 | __alignof__(struct property)); |
312 | if (allnextpp) { | 312 | if (allnextpp) { |
313 | if (strcmp(pname, "linux,phandle") == 0) { | 313 | /* We accept flattened tree phandles either in |
314 | * ePAPR-style "phandle" properties, or the | ||
315 | * legacy "linux,phandle" properties. If both | ||
316 | * appear and have different values, things | ||
317 | * will get weird. Don't do that. */ | ||
318 | if ((strcmp(pname, "phandle") == 0) || | ||
319 | (strcmp(pname, "linux,phandle") == 0)) { | ||
314 | if (np->phandle == 0) | 320 | if (np->phandle == 0) |
315 | np->phandle = *((u32 *)*p); | 321 | np->phandle = *((u32 *)*p); |
316 | } | 322 | } |
323 | /* And we process the "ibm,phandle" property | ||
324 | * used in pSeries dynamic device tree | ||
325 | * stuff */ | ||
317 | if (strcmp(pname, "ibm,phandle") == 0) | 326 | if (strcmp(pname, "ibm,phandle") == 0) |
318 | np->phandle = *((u32 *)*p); | 327 | np->phandle = *((u32 *)*p); |
319 | pp->name = pname; | 328 | pp->name = pname; |