aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/of_device_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/of_device_64.c')
-rw-r--r--arch/sparc/kernel/of_device_64.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 27381f1baffc..5ac287ac03de 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -300,8 +300,25 @@ static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags)
300 300
301static int of_bus_sbus_match(struct device_node *np) 301static int of_bus_sbus_match(struct device_node *np)
302{ 302{
303 return !strcmp(np->name, "sbus") || 303 struct device_node *dp = np;
304 !strcmp(np->name, "sbi"); 304
305 while (dp) {
306 if (!strcmp(dp->name, "sbus") ||
307 !strcmp(dp->name, "sbi"))
308 return 1;
309
310 /* Have a look at use_1to1_mapping(). We're trying
311 * to match SBUS if that's the top-level bus and we
312 * don't have some intervening real bus that provides
313 * ranges based translations.
314 */
315 if (of_find_property(dp, "ranges", NULL) != NULL)
316 break;
317
318 dp = dp->parent;
319 }
320
321 return 0;
305} 322}
306 323
307static void of_bus_sbus_count_cells(struct device_node *child, 324static void of_bus_sbus_count_cells(struct device_node *child,