Add release_device() hook to phb ops so we can clean up for specific phbs.

Signed-off-by: Michael Neuling <mi...@neuling.org>
---
 arch/powerpc/include/asm/pci-bridge.h | 2 ++
 arch/powerpc/kernel/pci-hotplug.c     | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/arch/powerpc/include/asm/pci-bridge.h 
b/arch/powerpc/include/asm/pci-bridge.h
index 6d17bb8..4cf0caa 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -27,6 +27,8 @@ struct pci_controller_ops {
         * allow assignment/enabling of the device. */
        bool            (*enable_device_hook)(struct pci_dev *);
 
+       void            (*release_device)(struct pci_dev *);
+
        /* Called during PCI resource reassignment */
        resource_size_t (*window_alignment)(struct pci_bus *, unsigned long 
type);
        void            (*reset_secondary_bus)(struct pci_dev *dev);
diff --git a/arch/powerpc/kernel/pci-hotplug.c 
b/arch/powerpc/kernel/pci-hotplug.c
index 7ed85a6..7f9ed0c 100644
--- a/arch/powerpc/kernel/pci-hotplug.c
+++ b/arch/powerpc/kernel/pci-hotplug.c
@@ -29,7 +29,12 @@
  */
 void pcibios_release_device(struct pci_dev *dev)
 {
+       struct pci_controller *phb = pci_bus_to_host(dev->bus);
+
        eeh_remove_device(dev);
+
+       if (phb->controller_ops.release_device)
+               phb->controller_ops.release_device(dev);
 }
 
 /**
-- 
2.1.0

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to