aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug-pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/hotplug-pci.c')
-rw-r--r--drivers/pci/hotplug-pci.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/pci/hotplug-pci.c b/drivers/pci/hotplug-pci.c
index d3509cdeb55..6258dc260d9 100644
--- a/drivers/pci/hotplug-pci.c
+++ b/drivers/pci/hotplug-pci.c
@@ -4,18 +4,26 @@
4#include <linux/export.h> 4#include <linux/export.h>
5#include "pci.h" 5#include "pci.h"
6 6
7 7int __ref pci_hp_add_bridge(struct pci_dev *dev)
8unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus)
9{ 8{
10 unsigned int max; 9 struct pci_bus *parent = dev->bus;
11 10 int pass, busnr, start = parent->busn_res.start;
12 max = pci_scan_child_bus(bus); 11 int end = parent->busn_res.end;
13 12
14 /* 13 for (busnr = start; busnr <= end; busnr++) {
15 * Make the discovered devices available. 14 if (!pci_find_bus(pci_domain_nr(parent), busnr))
16 */ 15 break;
17 pci_bus_add_devices(bus); 16 }
17 if (busnr-- > end) {
18 printk(KERN_ERR "No bus number available for hot-added bridge %s\n",
19 pci_name(dev));
20 return -1;
21 }
22 for (pass = 0; pass < 2; pass++)
23 busnr = pci_scan_bridge(parent, dev, busnr, pass);
24 if (!dev->subordinate)
25 return -1;
18 26
19 return max; 27 return 0;
20} 28}
21EXPORT_SYMBOL(pci_do_scan_bus); 29EXPORT_SYMBOL_GPL(pci_hp_add_bridge);