Commit b122c954 authored by Daniel Axtens's avatar Daniel Axtens Committed by Michael Ellerman

powerpc: Create pci_controller_ops.dma_bus_setup and shim

Add pci_controller_ops.dma_bus_setup, shadowing ppc_md.pci_dma_bus_setup.
Add a shim, and changes the callsites to use the shim.
Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent e02def5b
...@@ -19,6 +19,7 @@ struct device_node; ...@@ -19,6 +19,7 @@ struct device_node;
*/ */
struct pci_controller_ops { struct pci_controller_ops {
void (*dma_dev_setup)(struct pci_dev *dev); void (*dma_dev_setup)(struct pci_dev *dev);
void (*dma_bus_setup)(struct pci_bus *bus);
}; };
/* /*
...@@ -281,5 +282,15 @@ static inline void pci_dma_dev_setup(struct pci_dev *dev) ...@@ -281,5 +282,15 @@ static inline void pci_dma_dev_setup(struct pci_dev *dev)
ppc_md.pci_dma_dev_setup(dev); ppc_md.pci_dma_dev_setup(dev);
} }
static inline void pci_dma_bus_setup(struct pci_bus *bus)
{
struct pci_controller *phb = pci_bus_to_host(bus);
if (phb->controller_ops.dma_bus_setup)
phb->controller_ops.dma_bus_setup(bus);
else if (ppc_md.pci_dma_bus_setup)
ppc_md.pci_dma_bus_setup(bus);
}
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_PCI_BRIDGE_H */ #endif /* _ASM_POWERPC_PCI_BRIDGE_H */
...@@ -953,8 +953,7 @@ void pcibios_setup_bus_self(struct pci_bus *bus) ...@@ -953,8 +953,7 @@ void pcibios_setup_bus_self(struct pci_bus *bus)
ppc_md.pcibios_fixup_bus(bus); ppc_md.pcibios_fixup_bus(bus);
/* Setup bus DMA mappings */ /* Setup bus DMA mappings */
if (ppc_md.pci_dma_bus_setup) pci_dma_bus_setup(bus);
ppc_md.pci_dma_bus_setup(bus);
} }
static void pcibios_setup_device(struct pci_dev *dev) static void pcibios_setup_device(struct pci_dev *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment