Commit c6da81a4d3cb8d461f77c5f61843fcc9c18b6c2c

Authored by Yinghai Lu
Committed by Bjorn Helgaas
1 parent a8e4b9c101

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>

Showing 1 changed file with 2 additions and 26 deletions Side-by-side Diff

drivers/pci/hotplug/pciehp_pci.c
... ... @@ -34,29 +34,6 @@
34 34 #include "../pci.h"
35 35 #include "pciehp.h"
36 36  
37   -static int __ref pciehp_add_bridge(struct pci_dev *dev)
38   -{
39   - struct pci_bus *parent = dev->bus;
40   - int pass, busnr, start = parent->busn_res.start;
41   - int end = parent->busn_res.end;
42   -
43   - for (busnr = start; busnr <= end; busnr++) {
44   - if (!pci_find_bus(pci_domain_nr(parent), busnr))
45   - break;
46   - }
47   - if (busnr-- > end) {
48   - err("No bus number available for hot-added bridge %s\n",
49   - pci_name(dev));
50   - return -1;
51   - }
52   - for (pass = 0; pass < 2; pass++)
53   - busnr = pci_scan_bridge(parent, dev, busnr, pass);
54   - if (!dev->subordinate)
55   - return -1;
56   -
57   - return 0;
58   -}
59   -
60 37 int pciehp_configure_device(struct slot *p_slot)
61 38 {
62 39 struct pci_dev *dev;
... ... @@ -85,9 +62,8 @@
85 62 if (!dev)
86 63 continue;
87 64 if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) ||
88   - (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)) {
89   - pciehp_add_bridge(dev);
90   - }
  65 + (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS))
  66 + pci_hp_add_bridge(dev);
91 67 pci_dev_put(dev);
92 68 }
93 69