diff options
Diffstat (limited to 'arch/sparc64/kernel/pci.c')
-rw-r--r-- | arch/sparc64/kernel/pci.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c index b63341c2a334..6b94d97e56ad 100644 --- a/arch/sparc64/kernel/pci.c +++ b/arch/sparc64/kernel/pci.c | |||
@@ -469,6 +469,13 @@ static void __init apb_calc_first_last(u8 map, u32 *first_p, u32 *last_p) | |||
469 | *last_p = last; | 469 | *last_p = last; |
470 | } | 470 | } |
471 | 471 | ||
472 | static void __init pci_resource_adjust(struct resource *res, | ||
473 | struct resource *root) | ||
474 | { | ||
475 | res->start += root->start; | ||
476 | res->end += root->start; | ||
477 | } | ||
478 | |||
472 | /* Cook up fake bus resources for SUNW,simba PCI bridges which lack | 479 | /* Cook up fake bus resources for SUNW,simba PCI bridges which lack |
473 | * a proper 'ranges' property. | 480 | * a proper 'ranges' property. |
474 | */ | 481 | */ |
@@ -486,7 +493,7 @@ static void __init apb_fake_ranges(struct pci_dev *dev, | |||
486 | res->start = (first << 21); | 493 | res->start = (first << 21); |
487 | res->end = (last << 21) + ((1 << 21) - 1); | 494 | res->end = (last << 21) + ((1 << 21) - 1); |
488 | res->flags = IORESOURCE_IO; | 495 | res->flags = IORESOURCE_IO; |
489 | pbm->parent->resource_adjust(dev, res, &pbm->io_space); | 496 | pci_resource_adjust(res, &pbm->io_space); |
490 | 497 | ||
491 | pci_read_config_byte(dev, APB_MEM_ADDRESS_MAP, &map); | 498 | pci_read_config_byte(dev, APB_MEM_ADDRESS_MAP, &map); |
492 | apb_calc_first_last(map, &first, &last); | 499 | apb_calc_first_last(map, &first, &last); |
@@ -494,7 +501,7 @@ static void __init apb_fake_ranges(struct pci_dev *dev, | |||
494 | res->start = (first << 21); | 501 | res->start = (first << 21); |
495 | res->end = (last << 21) + ((1 << 21) - 1); | 502 | res->end = (last << 21) + ((1 << 21) - 1); |
496 | res->flags = IORESOURCE_MEM; | 503 | res->flags = IORESOURCE_MEM; |
497 | pbm->parent->resource_adjust(dev, res, &pbm->mem_space); | 504 | pci_resource_adjust(res, &pbm->mem_space); |
498 | } | 505 | } |
499 | 506 | ||
500 | static void __init pci_of_scan_bus(struct pci_pbm_info *pbm, | 507 | static void __init pci_of_scan_bus(struct pci_pbm_info *pbm, |
@@ -594,7 +601,7 @@ void __devinit of_scan_pci_bridge(struct pci_pbm_info *pbm, | |||
594 | * layer routine that can calculate a resource for a given | 601 | * layer routine that can calculate a resource for a given |
595 | * range property value in a PCI device. | 602 | * range property value in a PCI device. |
596 | */ | 603 | */ |
597 | pbm->parent->resource_adjust(dev, res, root); | 604 | pci_resource_adjust(res, root); |
598 | } | 605 | } |
599 | simba_cont: | 606 | simba_cont: |
600 | sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus), | 607 | sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus), |
@@ -803,7 +810,7 @@ void pcibios_resource_to_bus(struct pci_dev *pdev, struct pci_bus_region *region | |||
803 | else | 810 | else |
804 | root = &pbm->mem_space; | 811 | root = &pbm->mem_space; |
805 | 812 | ||
806 | pbm->parent->resource_adjust(pdev, &zero_res, root); | 813 | pci_resource_adjust(&zero_res, root); |
807 | 814 | ||
808 | region->start = res->start - zero_res.start; | 815 | region->start = res->start - zero_res.start; |
809 | region->end = res->end - zero_res.start; | 816 | region->end = res->end - zero_res.start; |
@@ -824,7 +831,7 @@ void pcibios_bus_to_resource(struct pci_dev *pdev, struct resource *res, | |||
824 | else | 831 | else |
825 | root = &pbm->mem_space; | 832 | root = &pbm->mem_space; |
826 | 833 | ||
827 | pbm->parent->resource_adjust(pdev, res, root); | 834 | pci_resource_adjust(res, root); |
828 | } | 835 | } |
829 | EXPORT_SYMBOL(pcibios_bus_to_resource); | 836 | EXPORT_SYMBOL(pcibios_bus_to_resource); |
830 | 837 | ||