Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pci: add pcibios_release_device

Platforms may want to provide architecture-specific functionality when
a pci device is released. Add a pcibios_release_device() call that
architectures can override to do so.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Sebastian Ott and committed by
Martin Schwidefsky
44b9ca47 24d5dd02

+12
+10
drivers/pci/pci.c
··· 1335 1335 } 1336 1336 1337 1337 /** 1338 + * pcibios_release_device - provide arch specific hooks when releasing device dev 1339 + * @dev: the PCI device being released 1340 + * 1341 + * Permits the platform to provide architecture specific functionality when 1342 + * devices are released. This is the default implementation. Architecture 1343 + * implementations can override this. 1344 + */ 1345 + void __weak pcibios_release_device(struct pci_dev *dev) {} 1346 + 1347 + /** 1338 1348 * pcibios_disable_device - disable arch specific PCI resources for device dev 1339 1349 * @dev: the PCI device to disable 1340 1350 *
+1
drivers/pci/probe.c
··· 1132 1132 pci_dev = to_pci_dev(dev); 1133 1133 pci_release_capabilities(pci_dev); 1134 1134 pci_release_of_node(pci_dev); 1135 + pcibios_release_device(pci_dev); 1135 1136 kfree(pci_dev); 1136 1137 } 1137 1138
+1
include/linux/pci.h
··· 1643 1643 int pcibios_set_pcie_reset_state(struct pci_dev *dev, 1644 1644 enum pcie_reset_state state); 1645 1645 int pcibios_add_device(struct pci_dev *dev); 1646 + void pcibios_release_device(struct pci_dev *dev); 1646 1647 1647 1648 #ifdef CONFIG_PCI_MMCONFIG 1648 1649 void __init pci_mmcfg_early_init(void);