diff options
author | Daniel Axtens <dja@axtens.net> | 2015-03-31 01:00:45 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2015-04-11 06:49:13 -0400 |
commit | b31e79f8d92ca115a935e37cfd4da74048739689 (patch) | |
tree | 15152735740773a6145bc929bd291e3a456a55df /arch/powerpc/include | |
parent | ff9df8c87d6807e90c5c3b0e1fd1649d09fd3bcd (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')
-rw-r--r-- | arch/powerpc/include/asm/pci-bridge.h | 15 |
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 { | |||
27 | void (*dma_bus_setup)(struct pci_bus *bus); | 27 | void (*dma_bus_setup)(struct pci_bus *bus); |
28 | 28 | ||
29 | int (*probe_mode)(struct pci_bus *); | 29 | int (*probe_mode)(struct pci_bus *); |
30 | |||
31 | /* Called when pci_enable_device() is called. Returns true to | ||
32 | * allow assignment/enabling of the device. */ | ||
33 | bool (*enable_device_hook)(struct pci_dev *); | ||
30 | }; | 34 | }; |
31 | 35 | ||
32 | /* | 36 | /* |
@@ -310,5 +314,16 @@ static inline int pci_probe_mode(struct pci_bus *bus) | |||
310 | return PCI_PROBE_NORMAL; | 314 | return PCI_PROBE_NORMAL; |
311 | } | 315 | } |
312 | 316 | ||
317 | static inline bool pcibios_enable_device_hook(struct pci_dev *dev) | ||
318 | { | ||
319 | struct pci_controller *phb = pci_bus_to_host(dev->bus); | ||
320 | |||
321 | if (phb->controller_ops.enable_device_hook) | ||
322 | return phb->controller_ops.enable_device_hook(dev); | ||
323 | if (ppc_md.pcibios_enable_device_hook) | ||
324 | return ppc_md.pcibios_enable_device_hook(dev); | ||
325 | return true; | ||
326 | } | ||
327 | |||
313 | #endif /* __KERNEL__ */ | 328 | #endif /* __KERNEL__ */ |
314 | #endif /* _ASM_POWERPC_PCI_BRIDGE_H */ | 329 | #endif /* _ASM_POWERPC_PCI_BRIDGE_H */ |