Skip to content

Commit

Permalink
PCI: Also call .add_bus() callback for root bus
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rob Herring authored and Lorenzo Pieralisi committed Sep 8, 2020
1 parent c2b0c09 commit 6e8e104
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,12 @@ static int pci_register_host_bridge(struct pci_host_bridge *bridge)

pcibios_add_bus(bus);

if (bus->ops->add_bus) {
err = bus->ops->add_bus(bus);
if (WARN_ON(err < 0))
dev_err(&bus->dev, "failed to add bus: %d\n", err);
}

/* Create legacy_io and legacy_mem files for this bus */
pci_create_legacy_files(bus);

Expand Down

0 comments on commit 6e8e104

Please sign in to comment.