@@ -552,10 +552,10 @@
struct pci_dev *dev;
struct pci_bus *bus = slot->bus;
struct acpiphp_func *func;
- int max, pass;
+ int nr_found, max, pass, bridges_scanned = 0;
LIST_HEAD(add_list);
- acpiphp_rescan_slot(slot);
+ nr_found = acpiphp_rescan_slot(slot);
max = acpiphp_max_busnr(bus);
for (pass = 0; pass < 2; pass++) {
list_for_each_entry(dev, &bus->devices, bus_list) {
@@ -571,9 +571,16 @@
__pci_bus_size_bridges(dev->subordinate,
&add_list);
}
+ bridges_scanned++;
}
}
}
+ /* Nothing more to do here if there are no new devices on this bus. */
+ if (!nr_found && !bridges_scanned && (slot->flags & SLOT_ENABLED)) {
+ pr_debug("No more new devices on this bus.\n");
+ return;
+ }
+
__pci_bus_assign_resources(bus, &add_list, NULL);
acpiphp_sanitize_bus(bus);