@@ -238,7 +238,10 @@ struct machdep_calls {
/* Called when pci_enable_device() is called. Returns 0 to
* allow assignment/enabling of the device. */
- int (*pcibios_enable_device_hook)(struct pci_dev *);
+ int (*pcibios_enable_device_hook)(struct pci_dev *);
+
+ /* Called when pci_disable_device() is called. */
+ void (*pcibios_disable_device_hook)(struct pci_dev *);
/* Called after scan and before resource survey */
void (*pcibios_fixup_phb)(struct pci_controller *hose);
@@ -1457,6 +1457,14 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
return pci_enable_resources(dev, mask);
}
+void pcibios_disable_device(struct pci_dev *dev)
+{
+ if (ppc_md.pcibios_disable_device_hook)
+ ppc_md.pcibios_disable_device_hook(dev);
+
+ return;
+}
+
resource_size_t pcibios_io_space_offset(struct pci_controller *hose)
{
return (unsigned long) hose->io_base_virt - _IO_BASE;
When driver remove a pci_dev, it will call pcibios_disable_device() which is platform dependent. This gives flexibility to platforms. This patch defines this weak function on powerpc architecture. Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com> --- arch/powerpc/include/asm/machdep.h | 5 ++++- arch/powerpc/kernel/pci-common.c | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-)