From df310656c7552ae7b8252e4b3d8e300cff164b16 Mon Sep 17 00:00:00 2001 From: Anton Blanchard Date: Sat, 10 Jun 2006 23:04:39 +1000 Subject: [POWERPC] cleanup dma_mapping_ops For pseries IOMMU bypass I want to be able to fall back to the regular IOMMU ops. Do this by creating a dma_mapping_ops struct, and convert the others while at it. Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras --- arch/powerpc/kernel/pci_direct_iommu.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'arch/powerpc/kernel/pci_direct_iommu.c') diff --git a/arch/powerpc/kernel/pci_direct_iommu.c b/arch/powerpc/kernel/pci_direct_iommu.c index e1a32f802c0b..72ce082ce738 100644 --- a/arch/powerpc/kernel/pci_direct_iommu.c +++ b/arch/powerpc/kernel/pci_direct_iommu.c @@ -82,13 +82,17 @@ static int pci_direct_dma_supported(struct device *dev, u64 mask) return mask < 0x100000000ull; } +static struct dma_mapping_ops pci_direct_ops = { + .alloc_coherent = pci_direct_alloc_coherent, + .free_coherent = pci_direct_free_coherent, + .map_single = pci_direct_map_single, + .unmap_single = pci_direct_unmap_single, + .map_sg = pci_direct_map_sg, + .unmap_sg = pci_direct_unmap_sg, + .dma_supported = pci_direct_dma_supported, +}; + void __init pci_direct_iommu_init(void) { - pci_dma_ops.alloc_coherent = pci_direct_alloc_coherent; - pci_dma_ops.free_coherent = pci_direct_free_coherent; - pci_dma_ops.map_single = pci_direct_map_single; - pci_dma_ops.unmap_single = pci_direct_unmap_single; - pci_dma_ops.map_sg = pci_direct_map_sg; - pci_dma_ops.unmap_sg = pci_direct_unmap_sg; - pci_dma_ops.dma_supported = pci_direct_dma_supported; + pci_dma_ops = pci_direct_ops; } -- cgit v1.2.1