[PATCH 08/27] powerpc: ppc_md.pci_dma_bus_setup -> pci_controller_ops.dma_bus_setup
Daniel Axtens
dja at axtens.net
Wed Mar 25 16:35:42 AEDT 2015
Signed-off-by: Daniel Axtens <dja at axtens.net>
---
arch/powerpc/include/asm/pci-bridge.h | 11 +++++++++++
arch/powerpc/kernel/pci-common.c | 3 +--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 2474f29..680a46d 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -19,6 +19,7 @@ struct device_node;
*/
struct pci_controller_ops {
void (*dma_dev_setup)(struct pci_dev *dev);
+ void (*dma_bus_setup)(struct pci_bus *bus);
};
/*
@@ -279,5 +280,15 @@ static inline void dma_dev_setup(struct pci_dev *dev)
ppc_md.pci_dma_dev_setup(dev);
}
+static inline void dma_bus_setup(struct pci_bus *bus)
+{
+ struct pci_controller *hose = pci_bus_to_host(bus);
+
+ if (hose->controller_ops.dma_bus_setup)
+ hose->controller_ops.dma_bus_setup(bus);
+ else if (ppc_md.pci_dma_bus_setup)
+ ppc_md.pci_dma_bus_setup(bus);
+}
+
#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 3ce6d0c..f5280ec 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -953,8 +953,7 @@ void pcibios_setup_bus_self(struct pci_bus *bus)
ppc_md.pcibios_fixup_bus(bus);
/* Setup bus DMA mappings */
- if (ppc_md.pci_dma_bus_setup)
- ppc_md.pci_dma_bus_setup(bus);
+ dma_bus_setup(bus);
}
static void pcibios_setup_device(struct pci_dev *dev)
--
2.1.4
More information about the Linuxppc-dev
mailing list