diff options
author | Yinghai Lu <yinghai@kernel.org> | 2012-05-17 21:58:41 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-06-13 17:42:26 -0400 |
commit | c6da81a4d3cb8d461f77c5f61843fcc9c18b6c2c (patch) | |
tree | 3d58b519b93f9ba5134e444828c6823c6f0d4d45 /drivers/pci/hotplug | |
parent | a8e4b9c101ae58cc64cda0201229d3318701a7f0 (diff) |
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')
-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 @@ | |||
34 | #include "../pci.h" | 34 | #include "../pci.h" |
35 | #include "pciehp.h" | 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 | int pciehp_configure_device(struct slot *p_slot) | 37 | int pciehp_configure_device(struct slot *p_slot) |
61 | { | 38 | { |
62 | struct pci_dev *dev; | 39 | struct pci_dev *dev; |
@@ -85,9 +62,8 @@ int pciehp_configure_device(struct slot *p_slot) | |||
85 | if (!dev) | 62 | if (!dev) |
86 | continue; | 63 | continue; |
87 | if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) || | 64 | if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) || |
88 | (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)) { | 65 | (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)) |
89 | pciehp_add_bridge(dev); | 66 | pci_hp_add_bridge(dev); |
90 | } | ||
91 | pci_dev_put(dev); | 67 | pci_dev_put(dev); |
92 | } | 68 | } |
93 | 69 | ||