提交 c6da81a4 编写于 作者: Y Yinghai Lu 提交者: Bjorn Helgaas

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: NYinghai Lu <yinghai@kernel.org>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 a8e4b9c1
...@@ -34,29 +34,6 @@ ...@@ -34,29 +34,6 @@
#include "../pci.h" #include "../pci.h"
#include "pciehp.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) int pciehp_configure_device(struct slot *p_slot)
{ {
struct pci_dev *dev; struct pci_dev *dev;
...@@ -85,9 +62,8 @@ int pciehp_configure_device(struct slot *p_slot) ...@@ -85,9 +62,8 @@ int pciehp_configure_device(struct slot *p_slot)
if (!dev) if (!dev)
continue; continue;
if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) || if ((dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) ||
(dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)) { (dev->hdr_type == PCI_HEADER_TYPE_CARDBUS))
pciehp_add_bridge(dev); pci_hp_add_bridge(dev);
}
pci_dev_put(dev); pci_dev_put(dev);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册