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>
This commit is contained in:

committed by
Bjorn Helgaas

parent
92e963f50f
commit
057bd2e052
@@ -758,6 +758,12 @@ add_dev:
|
||||
|
||||
pcibios_add_bus(child);
|
||||
|
||||
if (child->ops->add_bus) {
|
||||
ret = child->ops->add_bus(child);
|
||||
if (WARN_ON(ret < 0))
|
||||
dev_err(&child->dev, "failed to add bus: %d\n", ret);
|
||||
}
|
||||
|
||||
/* Create legacy_io and legacy_mem files for this bus */
|
||||
pci_create_legacy_files(child);
|
||||
|
||||
|
Reference in New Issue
Block a user