summaryrefslogtreecommitdiff
path: root/drivers/of/address.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2014-11-24 17:50:07 +0300
committerGrant Likely <grant.likely@linaro.org>2014-11-24 17:50:07 +0300
commit66e6a5a1fcd2f3e05f4d499b539a1f77ceb52d1d (patch)
treed72f980f64b88ea4e976215a503fcb038e02f981 /drivers/of/address.c
parent2d0747c4b68be8eb8ccfa2c538f2f5dd2ea89094 (diff)
parent5d01410fe4d92081f349b013a2e7a95429e4f2c9 (diff)
downloadlinux-66e6a5a1fcd2f3e05f4d499b539a1f77ceb52d1d.tar.xz
Merge tag 'v3.18-rc6' into devicetree/next
v3.18-rc6 contains an important DT bug fix, c1a2086e2d, "of/selftest: Fix off-by-one error in removal path" which affects testing of the overlay patch series. Merge it into the devicetree/next staging branch so that the overlay patches are applied on top of a known working tree. Linux 3.18-rc6 Conflicts: drivers/of/address.c
Diffstat (limited to 'drivers/of/address.c')
-rw-r--r--drivers/of/address.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/of/address.c b/drivers/of/address.c
index 78f02f65fc48..ad2906919d45 100644
--- a/drivers/of/address.c
+++ b/drivers/of/address.c
@@ -450,6 +450,21 @@ static struct of_bus *of_match_bus(struct device_node *np)
return NULL;
}
+static int of_empty_ranges_quirk(void)
+{
+ if (IS_ENABLED(CONFIG_PPC)) {
+ /* To save cycles, we cache the result */
+ static int quirk_state = -1;
+
+ if (quirk_state < 0)
+ quirk_state =
+ of_machine_is_compatible("Power Macintosh") ||
+ of_machine_is_compatible("MacRISC");
+ return quirk_state;
+ }
+ return false;
+}
+
static int of_translate_one(struct device_node *parent, struct of_bus *bus,
struct of_bus *pbus, __be32 *addr,
int na, int ns, int pna, const char *rprop)
@@ -475,12 +490,10 @@ static int of_translate_one(struct device_node *parent, struct of_bus *bus,
* This code is only enabled on powerpc. --gcl
*/
ranges = of_get_property(parent, rprop, &rlen);
-#if !defined(CONFIG_PPC)
- if (ranges == NULL) {
+ if (ranges == NULL && !of_empty_ranges_quirk()) {
pr_debug("OF: no ranges; cannot translate\n");
return 1;
}
-#endif /* !defined(CONFIG_PPC) */
if (ranges == NULL || rlen == 0) {
offset = of_read_number(addr, na);
memset(addr, 0, pna * 4);