PCI: Clean up usages of pci_bus->is_added
authorJiang Liu <liuj97@gmail.com>
Fri, 12 Apr 2013 05:44:16 +0000 (05:44 +0000)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 12 Apr 2013 21:38:25 +0000 (15:38 -0600)
Now pci_bus->is_added is only used to guard invoking of
pcibios_fixup_bus() in pci_scan_child_bus(), so just set
it directly after the fixups and remove the other test
and set in pci_bus_add_devices().

[bhelgaas: changelog]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Yinghai Lu <yinghai@kernel.org>
drivers/pci/bus.c
drivers/pci/probe.c

index 8647dc6f52d0cfab432826a1261118c487d29bad..bdc1e8bf7e608381e610eeabeebc33fc1369e5af 100644 (file)
@@ -206,16 +206,9 @@ void pci_bus_add_devices(const struct pci_bus *bus)
 
        list_for_each_entry(dev, &bus->devices, bus_list) {
                BUG_ON(!dev->is_added);
-
                child = dev->subordinate;
-
-               if (!child)
-                       continue;
-               pci_bus_add_devices(child);
-
-               if (child->is_added)
-                       continue;
-               child->is_added = 1;
+               if (child)
+                       pci_bus_add_devices(child);
        }
 }
 
index b494066ef32f5f08e3f5d4f4b3d88acf9257d710..45c93b39af35faa192e37eeb8338d3c216ff4c87 100644 (file)
@@ -1627,8 +1627,7 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus)
        if (!bus->is_added) {
                dev_dbg(&bus->dev, "fixups for bus\n");
                pcibios_fixup_bus(bus);
-               if (pci_is_root_bus(bus))
-                       bus->is_added = 1;
+               bus->is_added = 1;
        }
 
        for (pass=0; pass < 2; pass++)