Skip to content

Commit 981cf9e

Browse files
jiangliubjorn-helgaas
authored andcommitted
PCI: Clean up usages of pci_bus->is_added
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>
1 parent 1e89d26 commit 981cf9e

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

‎drivers/pci/bus.c‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,9 @@ void pci_bus_add_devices(const struct pci_bus *bus)
206206

207207
list_for_each_entry(dev, &bus->devices, bus_list) {
208208
BUG_ON(!dev->is_added);
209-
210209
child = dev->subordinate;
211-
212-
if (!child)
213-
continue;
214-
pci_bus_add_devices(child);
215-
216-
if (child->is_added)
217-
continue;
218-
child->is_added = 1;
210+
if (child)
211+
pci_bus_add_devices(child);
219212
}
220213
}
221214

‎drivers/pci/probe.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,8 +1627,7 @@ unsigned int pci_scan_child_bus(struct pci_bus *bus)
16271627
if (!bus->is_added) {
16281628
dev_dbg(&bus->dev, "fixups for bus\n");
16291629
pcibios_fixup_bus(bus);
1630-
if (pci_is_root_bus(bus))
1631-
bus->is_added = 1;
1630+
bus->is_added = 1;
16321631
}
16331632

16341633
for (pass=0; pass < 2; pass++)

0 commit comments

Comments
 (0)