summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/pci-bridge.h
diff options
context:
space:
mode:
authorDaniel Axtens <dja@axtens.net>2015-03-31 16:00:45 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2015-04-11 20:49:13 +1000
commitb31e79f8d92ca115a935e37cfd4da74048739689 (patch)
tree15152735740773a6145bc929bd291e3a456a55df /arch/powerpc/include/asm/pci-bridge.h
parentff9df8c87d6807e90c5c3b0e1fd1649d09fd3bcd (diff)
powerpc: Create pci_controller_ops.enable_device_hook and shim
Add pci_controller_ops.enable_device_hook, shadowing ppc_md.pcibios_enable_device_hook. Add a shim, and changes the callsites to use the shim. Signed-off-by: Daniel Axtens <dja@axtens.net> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/pci-bridge.h')
-rw-r--r--arch/powerpc/include/asm/pci-bridge.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 278f48978bad..9d02ea6255ff 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -27,6 +27,10 @@ struct pci_controller_ops {
void (*dma_bus_setup)(struct pci_bus *bus);
int (*probe_mode)(struct pci_bus *);
+
+ /* Called when pci_enable_device() is called. Returns true to
+ * allow assignment/enabling of the device. */
+ bool (*enable_device_hook)(struct pci_dev *);
};
/*
@@ -310,5 +314,16 @@ static inline int pci_probe_mode(struct pci_bus *bus)
return PCI_PROBE_NORMAL;
}
+static inline bool pcibios_enable_device_hook(struct pci_dev *dev)
+{
+ struct pci_controller *phb = pci_bus_to_host(dev->bus);
+
+ if (phb->controller_ops.enable_device_hook)
+ return phb->controller_ops.enable_device_hook(dev);
+ if (ppc_md.pcibios_enable_device_hook)
+ return ppc_md.pcibios_enable_device_hook(dev);
+ return true;
+}
+
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PCI_BRIDGE_H */