Skip to content

Commit

Permalink
PCI: Add pcibios_release_device()
Browse files Browse the repository at this point in the history
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: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Sebastian Ott authored and Bjorn Helgaas committed Jun 4, 2013
1 parent 9a994e8 commit 6ae32c5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/pci/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,16 @@ int __weak pcibios_add_device (struct pci_dev *dev)
return 0;
}

/**
* pcibios_release_device - provide arch specific hooks when releasing device dev
* @dev: the PCI device being released
*
* Permits the platform to provide architecture specific functionality when
* devices are released. This is the default implementation. Architecture
* implementations can override this.
*/
void __weak pcibios_release_device(struct pci_dev *dev) {}

/**
* pcibios_disable_device - disable arch specific PCI resources for device dev
* @dev: the PCI device to disable
Expand Down
1 change: 1 addition & 0 deletions drivers/pci/probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,7 @@ static void pci_release_dev(struct device *dev)
pci_dev = to_pci_dev(dev);
pci_release_capabilities(pci_dev);
pci_release_of_node(pci_dev);
pcibios_release_device(pci_dev);
kfree(pci_dev);
}

Expand Down
1 change: 1 addition & 0 deletions include/linux/pci.h
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,7 @@ void pcibios_set_master(struct pci_dev *dev);
int pcibios_set_pcie_reset_state(struct pci_dev *dev,
enum pcie_reset_state state);
int pcibios_add_device(struct pci_dev *dev);
void pcibios_release_device(struct pci_dev *dev);

#ifdef CONFIG_PCI_MMCONFIG
void __init pci_mmcfg_early_init(void);
Expand Down

0 comments on commit 6ae32c5

Please sign in to comment.