Skip to content

Commit

Permalink
powerpc: Create pci_controller_ops.dma_bus_setup and shim
Browse files Browse the repository at this point in the history
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: Daniel Axtens <dja@axtens.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Daniel Axtens authored and Michael Ellerman committed Apr 11, 2015
1 parent e02def5 commit b122c95
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
11 changes: 11 additions & 0 deletions arch/powerpc/include/asm/pci-bridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

/*
Expand Down Expand Up @@ -281,5 +282,15 @@ static inline void pci_dma_dev_setup(struct pci_dev *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 /* _ASM_POWERPC_PCI_BRIDGE_H */
3 changes: 1 addition & 2 deletions arch/powerpc/kernel/pci-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
pci_dma_bus_setup(bus);
}

static void pcibios_setup_device(struct pci_dev *dev)
Expand Down

0 comments on commit b122c95

Please sign in to comment.