aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/address.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 0b04137f04f7..5c220c3a3acc 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -346,12 +346,21 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
346 * a 1:1 translation at that level. It's up to the caller not to try 346 * a 1:1 translation at that level. It's up to the caller not to try
347 * to translate addresses that aren't supposed to be translated in 347 * to translate addresses that aren't supposed to be translated in
348 * the first place. --BenH. 348 * the first place. --BenH.
349 *
350 * As far as we know, this damage only exists on Apple machines, so
351 * This code is only enabled on powerpc. --gcl
349 */ 352 */
350 ranges = of_get_property(parent, rprop, &rlen); 353 ranges = of_get_property(parent, rprop, &rlen);
354#if !defined(CONFIG_PPC)
355 if (ranges == NULL) {
356 pr_err("OF: no ranges; cannot translate\n");
357 return 1;
358 }
359#endif /* !defined(CONFIG_PPC) */
351 if (ranges == NULL || rlen == 0) { 360 if (ranges == NULL || rlen == 0) {
352 offset = of_read_number(addr, na); 361 offset = of_read_number(addr, na);
353 memset(addr, 0, pna * 4); 362 memset(addr, 0, pna * 4);
354 pr_debug("OF: no ranges, 1:1 translation\n"); 363 pr_debug("OF: empty ranges; 1:1 translation\n");
355 goto finish; 364 goto finish;
356 } 365 }
357 366