aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-06-08 09:48:11 -0400
committerGrant Likely <grant.likely@secretlab.ca>2010-07-05 18:14:27 -0400
commit3930f294d081c9e2a65f137a7d5fb6c161e4aa94 (patch)
tree7067d9ca87a0c2e885801dd91d72944a0aee2d22 /drivers
parent154063a9c03d31228b6f9366d2ffc2b7c4961698 (diff)
of/address: restrict 'no-ranges' kludge to powerpc
Certain Apple machines don't use the ranges property correctly, but the workaround should not be applied on other architectures. This patch disables the workaround for non-powerpc architectures. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> CC: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'drivers')
-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