summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/pci-bridge.h
diff options
context:
space:
mode:
authorDaniel Axtens <dja@axtens.net>2015-03-31 08:00:47 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2015-04-11 13:49:14 +0300
commitcd16c7ba0cc21aa1563e4b8430519b6488d0de60 (patch)
tree53d2f175dba879e96011ea1ae31b99fcc6a0a274 /arch/powerpc/include/asm/pci-bridge.h
parent542070baf4a0fe9de14cc2c4ca3ff1b43f14f90f (diff)
downloadlinux-cd16c7ba0cc21aa1563e4b8430519b6488d0de60.tar.xz
powerpc: Create pci_controller_ops.reset_secondary_bus and shim
Add pci_controller_ops.reset_secondary_bus, shadowing ppc_md.pcibios_reset_secondary_bus. Add a shim, and changes the callsites to use the shim. Use pcibios_reset_secondary_bus_shim, as both pcibios_reset_secondary_bus and pci_reset_secondary_bus are already taken. 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.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index ed4f8ce803bb..bb34b1eebfbe 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -34,6 +34,7 @@ struct pci_controller_ops {
/* Called during PCI resource reassignment */
resource_size_t (*window_alignment)(struct pci_bus *, unsigned long type);
+ void (*reset_secondary_bus)(struct pci_dev *dev);
};
/*
@@ -346,5 +347,21 @@ static inline resource_size_t pci_window_alignment(struct pci_bus *bus,
return 1;
}
+static inline void pcibios_reset_secondary_bus_shim(struct pci_dev *dev)
+{
+ struct pci_controller *phb = pci_bus_to_host(dev->bus);
+
+ if (phb->controller_ops.reset_secondary_bus)
+ phb->controller_ops.reset_secondary_bus(dev);
+ else if (ppc_md.pcibios_reset_secondary_bus)
+ ppc_md.pcibios_reset_secondary_bus(dev);
+ else
+ /*
+ * Fallback to the generic function if no
+ * platform-specific one is provided
+ */
+ pci_reset_secondary_bus(dev);
+}
+
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PCI_BRIDGE_H */