diff options
| -rw-r--r-- | arch/sparc/kernel/of_device_32.c | 21 | ||||
| -rw-r--r-- | arch/sparc/kernel/of_device_64.c | 21 |
2 files changed, 38 insertions, 4 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 | ||
| 247 | static int of_bus_sbus_match(struct device_node *np) | 247 | static 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 | ||
| 253 | static void of_bus_sbus_count_cells(struct device_node *child, | 270 | static void of_bus_sbus_count_cells(struct device_node *child, |
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 | ||
| 301 | static int of_bus_sbus_match(struct device_node *np) | 301 | static 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 | ||
| 307 | static void of_bus_sbus_count_cells(struct device_node *child, | 324 | static void of_bus_sbus_count_cells(struct device_node *child, |
