[PATCH 12/27] powerpc: ppc_md.pcibios_reset_secondary_bus -> pci_controller_ops.reset_secondary_bus
Daniel Axtens
dja at axtens.net
Wed Mar 25 16:35:46 AEDT 2015
Signed-off-by: Daniel Axtens <dja at axtens.net>
---
arch/powerpc/include/asm/pci-bridge.h | 17 +++++++++++++++++
arch/powerpc/kernel/pci-common.c | 7 +------
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index dbd143f..ea9496b 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);
};
/*
@@ -344,5 +345,21 @@ static inline resource_size_t pci_window_alignment(struct pci_bus *bus,
return 1;
}
+static inline void reset_secondary_bus(struct pci_dev *dev)
+{
+ struct pci_controller *hose = pci_bus_to_host(dev->bus);
+
+ if (hose->controller_ops.reset_secondary_bus)
+ hose->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 */
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index c2bc023..67d4dcb 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -114,12 +114,7 @@ resource_size_t pcibios_window_alignment(struct pci_bus *bus,
void pcibios_reset_secondary_bus(struct pci_dev *dev)
{
- if (ppc_md.pcibios_reset_secondary_bus) {
- ppc_md.pcibios_reset_secondary_bus(dev);
- return;
- }
-
- pci_reset_secondary_bus(dev);
+ reset_secondary_bus(dev);
}
static resource_size_t pcibios_io_size(const struct pci_controller *hose)
--
2.1.4
More information about the Linuxppc-dev
mailing list