diff options
author | Rob Herring <robh@kernel.org> | 2020-08-21 06:53:54 +0300 |
---|---|---|
committer | Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | 2020-09-08 18:37:02 +0300 |
commit | 6e8e104d21962177b26149643e66a8af0099734c (patch) | |
tree | bfa0295923890f4156193276ac2ea545c9dde907 /drivers/pci/probe.c | |
parent | c2b0c098fbd15da06f5c6c70ecc9b156fdc0eedd (diff) | |
download | linux-6e8e104d21962177b26149643e66a8af0099734c.tar.xz |
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>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 0c9ebc72532e..d8bf3fe8dacd 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -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); |