diff options
Diffstat (limited to 'drivers/pci/hotplug-pci.c')
| -rw-r--r-- | drivers/pci/hotplug-pci.c | 31 | 
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/pci/hotplug-pci.c b/drivers/pci/hotplug-pci.c index 4d4a6447840..c68366cee6b 100644 --- a/drivers/pci/hotplug-pci.c +++ b/drivers/pci/hotplug-pci.c @@ -1,20 +1,29 @@  /* Core PCI functionality used only by PCI hotplug */  #include <linux/pci.h> +#include <linux/export.h>  #include "pci.h" - -unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus) +int pci_hp_add_bridge(struct pci_dev *dev)  { -	unsigned int max; - -	max = pci_scan_child_bus(bus); +	struct pci_bus *parent = dev->bus; +	int pass, busnr, start = parent->busn_res.start; +	int end = parent->busn_res.end; -	/* -	 * Make the discovered devices available. -	 */ -	pci_bus_add_devices(bus); +	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 max; +	return 0;  } -EXPORT_SYMBOL(pci_do_scan_bus); +EXPORT_SYMBOL_GPL(pci_hp_add_bridge);  | 
