@@ -526,7 +526,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
* Maybe the desired pci bus has been already scanned. In such case
* it is unnecessary to scan the pci bus with the given domain,busnum.
*/
- bus = pci_find_bus(domain, busnum);
+ bus = pci_get_bus(domain, busnum);
if (bus) {
/*
* If the desired bus exits, the content of bus->sysdata will
@@ -534,6 +534,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
*/
memcpy(bus->sysdata, sd, sizeof(*sd));
kfree(info);
+ pci_bus_put(bus);
} else {
probe_pci_root_info(info, device, busnum, domain);
@@ -460,8 +460,9 @@ struct pci_bus *pcibios_scan_root(int busnum)
{
struct pci_bus *bus = NULL;
- while ((bus = pci_find_next_bus(bus)) != NULL) {
+ for_each_pci_root_bus(bus) {
if (bus->number == busnum) {
+ pci_bus_put(bus);
/* Already scanned */
return bus;
}
@@ -343,7 +343,7 @@ static int __init pcibios_assign_resources(void)
struct pci_bus *bus;
if (!(pci_probe & PCI_ASSIGN_ROMS))
- list_for_each_entry(bus, &pci_root_buses, node)
+ for_each_pci_root_bus(bus)
pcibios_allocate_rom_resources(bus);
pci_assign_unassigned_resources();
@@ -371,12 +371,11 @@ void __init pcibios_resource_survey(void)
DBG("PCI: Allocating resources\n");
- list_for_each_entry(bus, &pci_root_buses, node)
+ for_each_pci_root_bus(bus)
pcibios_allocate_bus_resources(bus);
-
- list_for_each_entry(bus, &pci_root_buses, node)
+ for_each_pci_root_bus(bus)
pcibios_allocate_resources(bus, 0);
- list_for_each_entry(bus, &pci_root_buses, node)
+ for_each_pci_root_bus(bus)
pcibios_allocate_resources(bus, 1);
e820_reserve_resources_late();
@@ -137,7 +137,7 @@ static void __init pirq_peer_trick(void)
}
for (i = 1; i < 256; i++) {
int node;
- if (!busmap[i] || pci_find_bus(0, i))
+ if (!busmap[i] || pci_bus_exists(0, i))
continue;
node = get_mp_bus_to_node(i);
if (pci_scan_bus_on_node(i, &pci_root_ops, node))
@@ -40,7 +40,7 @@ void pcibios_scan_specific_bus(int busn)
long node;
u32 l;
- if (pci_find_bus(0, busn))
+ if (pci_bus_exists(0, busn))
return;
node = get_mp_bus_to_node(busn);