diff options
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/kernel/pci.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index cc4c31e5185e..b36365f49478 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -617,6 +617,36 @@ static void pci_bus_register_of_sysfs(struct pci_bus *bus) | |||
617 | pci_bus_register_of_sysfs(child_bus); | 617 | pci_bus_register_of_sysfs(child_bus); |
618 | } | 618 | } |
619 | 619 | ||
620 | static void pci_claim_bus_resources(struct pci_bus *bus) | ||
621 | { | ||
622 | struct pci_bus *child_bus; | ||
623 | struct pci_dev *dev; | ||
624 | |||
625 | list_for_each_entry(dev, &bus->devices, bus_list) { | ||
626 | int i; | ||
627 | |||
628 | for (i = 0; i < PCI_NUM_RESOURCES; i++) { | ||
629 | struct resource *r = &dev->resource[i]; | ||
630 | |||
631 | if (r->parent || !r->start || !r->flags) | ||
632 | continue; | ||
633 | |||
634 | if (ofpci_verbose) | ||
635 | printk("PCI: Claiming %s: " | ||
636 | "Resource %d: %016llx..%016llx [%x]\n", | ||
637 | pci_name(dev), i, | ||
638 | (unsigned long long)r->start, | ||
639 | (unsigned long long)r->end, | ||
640 | (unsigned int)r->flags); | ||
641 | |||
642 | pci_claim_resource(dev, i); | ||
643 | } | ||
644 | } | ||
645 | |||
646 | list_for_each_entry(child_bus, &bus->children, node) | ||
647 | pci_claim_bus_resources(child_bus); | ||
648 | } | ||
649 | |||
620 | struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm, | 650 | struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm, |
621 | struct device *parent) | 651 | struct device *parent) |
622 | { | 652 | { |
@@ -647,6 +677,8 @@ struct pci_bus *pci_scan_one_pbm(struct pci_pbm_info *pbm, | |||
647 | pci_bus_add_devices(bus); | 677 | pci_bus_add_devices(bus); |
648 | pci_bus_register_of_sysfs(bus); | 678 | pci_bus_register_of_sysfs(bus); |
649 | 679 | ||
680 | pci_claim_bus_resources(bus); | ||
681 | |||
650 | return bus; | 682 | return bus; |
651 | } | 683 | } |
652 | 684 | ||