diff options
author | Yinghai Lu <yinghai@kernel.org> | 2012-05-17 18:58:41 -0700 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-06-13 15:42:26 -0600 |
commit | c6da81a4d3cb8d461f77c5f61843fcc9c18b6c2c (patch) | |
tree | 3d58b519b93f9ba5134e444828c6823c6f0d4d45 /drivers/pci/hotplug/pciehp_pci.c | |
parent | a8e4b9c101ae58cc64cda0201229d3318701a7f0 (diff) | |
download | linux-c6da81a4d3cb8d461f77c5f61843fcc9c18b6c2c.tar.gz linux-c6da81a4d3cb8d461f77c5f61843fcc9c18b6c2c.tar.bz2 linux-c6da81a4d3cb8d461f77c5f61843fcc9c18b6c2c.zip |
PCI: pciehp: use generic pci_hp_add_bridge()
Use the new generic pci_hp_add_bridge() interface.
[bhelgaas: split "add generic pci_hp_add_bridge()" into a separate patch]
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/hotplug/pciehp_pci.c')
-rw-r--r-- | drivers/pci/hotplug/pciehp_pci.c | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c index b898f06b588d..09cecaf450c5 100644 --- a/drivers/pci/hotplug/pciehp_pci.c +++ b/drivers/pci/hotplug/pciehp_pci.c @@ -34,29 +34,6 @@ #include "../pci.h" #include "pciehp.h" -static int __ref pciehp_add_bridge(struct pci_dev *dev) -{ - struct pci_bus *parent = dev->bus; - int pass, busnr, start = parent->busn_res.start; - int end = parent->busn_res.end; - - for (busnr = start; busnr <= end; busnr++) { - if (!pci_find_bus(pci_domain_nr(parent), busnr)) - break; - } - if (busnr-- > end) { - err("No bus number available for hot-added bridge %s\n", - pci_name(dev)); - return -1; - } - for (pass = 0; pass < 2; pass++) - busnr = pci_scan_bridge(parent, dev, busnr, pass); - if (!dev->subordinate) - return -1; - - return 0; -} - int pciehp_configure_device(struct slot *p_slot) { struct pci_dev *dev; @@ -85,9 +62,8 @@ int pciehp_configure_device(struct slot *p_slot) if (!dev) continue; if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) || - (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)) { - pciehp_add_bridge(dev); - } + (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)) + pci_hp_add_bridge(dev); pci_dev_put(dev); } |