diff options
author | Thierry Reding <treding@nvidia.com> | 2016-02-09 15:30:47 +0100 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2016-03-08 22:40:37 +0100 |
commit | 057bd2e0528ec68b3d0481ede0b26a31a9e5d2f1 (patch) | |
tree | 625e014188543c4f109a06de166c61b72f64ca7a /drivers/pci/remove.c | |
parent | Linux 4.5-rc1 (diff) | |
download | linux-057bd2e0528ec68b3d0481ede0b26a31a9e5d2f1.tar.xz linux-057bd2e0528ec68b3d0481ede0b26a31a9e5d2f1.zip |
PCI: Add pci_ops.{add,remove}_bus() callbacks
Add pci_ops.{add,remove}_bus() callbacks, which will be called on every
newly created bus and when a bus is being removed, respectively. This can
be used by drivers to implement driver-specific initialization and teardown
of the bus, in addition to the architecture-specifics implemented by the
pcibios_add_bus() and the pcibios_remove_bus() functions.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'drivers/pci/remove.c')
-rw-r--r-- | drivers/pci/remove.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c index 8a280e9c2ad1..d35c7fcde3af 100644 --- a/drivers/pci/remove.c +++ b/drivers/pci/remove.c @@ -54,6 +54,10 @@ void pci_remove_bus(struct pci_bus *bus) pci_bus_release_busn_res(bus); up_write(&pci_bus_sem); pci_remove_legacy_files(bus); + + if (bus->ops->remove_bus) + bus->ops->remove_bus(bus); + pcibios_remove_bus(bus); device_unregister(&bus->dev); } |