aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/of_device_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/of_device_32.c')
-rw-r--r--arch/sparc/kernel/of_device_32.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index 0a83bd737654..c8f14c1dc521 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -246,8 +246,25 @@ static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags)
246 246
247static int of_bus_sbus_match(struct device_node *np) 247static int of_bus_sbus_match(struct device_node *np)
248{ 248{
249 return !strcmp(np->name, "sbus") || 249 struct device_node *dp = np;
250 !strcmp(np->name, "sbi"); 250
251 while (dp) {
252 if (!strcmp(dp->name, "sbus") ||
253 !strcmp(dp->name, "sbi"))
254 return 1;
255
256 /* Have a look at use_1to1_mapping(). We're trying
257 * to match SBUS if that's the top-level bus and we
258 * don't have some intervening real bus that provides
259 * ranges based translations.
260 */
261 if (of_find_property(dp, "ranges", NULL) != NULL)
262 break;
263
264 dp = dp->parent;
265 }
266
267 return 0;
251} 268}
252 269
253static void of_bus_sbus_count_cells(struct device_node *child, 270static void of_bus_sbus_count_cells(struct device_node *child,