aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/of_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc64/kernel/of_device.c')
-rw-r--r--arch/sparc64/kernel/of_device.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index 16cc46a71872..6676b93219dc 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -343,6 +343,15 @@ static int of_bus_simba_match(struct device_node *np)
343 343
344 if (model && !strcmp(model, "SUNW,simba")) 344 if (model && !strcmp(model, "SUNW,simba"))
345 return 1; 345 return 1;
346
347 /* Treat PCI busses lacking ranges property just like
348 * simba.
349 */
350 if (!strcmp(np->type, "pci") || !strcmp(np->type, "pciex")) {
351 if (!of_find_property(np, "ranges", NULL))
352 return 1;
353 }
354
346 return 0; 355 return 0;
347} 356}
348 357
@@ -549,8 +558,6 @@ static int __init build_one_resource(struct device_node *parent,
549 558
550static int __init use_1to1_mapping(struct device_node *pp) 559static int __init use_1to1_mapping(struct device_node *pp)
551{ 560{
552 const char *model;
553
554 /* If this is on the PMU bus, don't try to translate it even 561 /* If this is on the PMU bus, don't try to translate it even
555 * if a ranges property exists. 562 * if a ranges property exists.
556 */ 563 */
@@ -567,9 +574,11 @@ static int __init use_1to1_mapping(struct device_node *pp)
567 if (!strcmp(pp->name, "dma")) 574 if (!strcmp(pp->name, "dma"))
568 return 0; 575 return 0;
569 576
570 /* Similarly for Simba PCI bridges. */ 577 /* Similarly for all PCI bridges, if we get this far
571 model = of_get_property(pp, "model", NULL); 578 * it lacks a ranges property, and this will include
572 if (model && !strcmp(model, "SUNW,simba")) 579 * cases like Simba.
580 */
581 if (!strcmp(pp->type, "pci") || !strcmp(pp->type, "pciex"))
573 return 0; 582 return 0;
574 583
575 return 1; 584 return 1;