mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-23 20:53:53 +08:00
10874f5a00
Some PCI functions used to be marked __devinit. When CONFIG_HOTPLUG was not set, these functions were discarded after boot. A few callers of these __devinit functions were marked __ref to indicate that they could safely call the __devinit functions even though the callers were not __devinit. But CONFIG_HOTPLUG and __devinit are now gone, and the need for the __ref annotations is also gone, so remove them. Relevant historical commits:54b956b903
Remove __dev* markings from init.ha8e4b9c101
PCI: add generic pci_hp_add_bridge()0ab2b57f8d
PCI: fix section mismatch warning in pci_scan_child_bus451124a7cc
PCI: fix 4x section mismatch warnings Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
30 lines
702 B
C
30 lines
702 B
C
/* Core PCI functionality used only by PCI hotplug */
|
|
|
|
#include <linux/pci.h>
|
|
#include <linux/export.h>
|
|
#include "pci.h"
|
|
|
|
int pci_hp_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) {
|
|
printk(KERN_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;
|
|
}
|
|
EXPORT_SYMBOL_GPL(pci_hp_add_bridge);
|