Skip to content

Commit 6e8e104

Browse files
robherringLorenzo Pieralisi
authored andcommitted
PCI: Also call .add_bus() callback for root bus
Similar to pcibios_add_bus(), call pci_ops.add_bus() when the root bus is added. This allows host bridge drivers to do any setup requiring a bus pointer. There are currently no .add_bus() callbacks, so this is safe to do. Link: https://lore.kernel.org/r/20200821035420.380495-15-robh@kernel.org Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Bjorn Helgaas <bhelgaas@google.com>
1 parent c2b0c09 commit 6e8e104

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/pci/probe.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,12 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)
941941

942942
pcibios_add_bus(bus);
943943

944+
if (bus->ops->add_bus) {
945+
err = bus->ops->add_bus(bus);
946+
if (WARN_ON(err < 0))
947+
dev_err(&bus->dev, "failed to add bus: %d\n", err);
948+
}
949+
944950
/* Create legacy_io and legacy_mem files for this bus */
945951
pci_create_legacy_files(bus);
946952

0 commit comments

Comments
 (0)