summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/dma-iommu.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-05-21 14:17:10 +0200
committerChristoph Hellwig <hch@lst.de>2017-06-28 06:54:33 -0700
commit6009faa43f804c99b3d8fff94fa1e0692be70358 (patch)
tree05168471d1bc2b5d056a7e77bdc1bfd8ff844eb2 /arch/powerpc/kernel/dma-iommu.c
parentceaf481c4f6ae6090288528825abc7d051bb1032 (diff)
downloadtalos-obmc-linux-6009faa43f804c99b3d8fff94fa1e0692be70358.tar.gz
talos-obmc-linux-6009faa43f804c99b3d8fff94fa1e0692be70358.zip
powerpc: implement ->mapping_error
DMA_ERROR_CODE is going to go away, so don't rely on it. Instead define a ->mapping_error method for all IOMMU based dma operation instances. The direct ops don't ever return an error and don't need a ->mapping_error method. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/dma-iommu.c')
-rw-r--r--arch/powerpc/kernel/dma-iommu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c
index fb7cbaa37658..8f7abf9baa63 100644
--- a/arch/powerpc/kernel/dma-iommu.c
+++ b/arch/powerpc/kernel/dma-iommu.c
@@ -105,6 +105,11 @@ static u64 dma_iommu_get_required_mask(struct device *dev)
return mask;
}
+int dma_iommu_mapping_error(struct device *dev, dma_addr_t dma_addr)
+{
+ return dma_addr == IOMMU_MAPPING_ERROR;
+}
+
struct dma_map_ops dma_iommu_ops = {
.alloc = dma_iommu_alloc_coherent,
.free = dma_iommu_free_coherent,
@@ -115,5 +120,6 @@ struct dma_map_ops dma_iommu_ops = {
.map_page = dma_iommu_map_page,
.unmap_page = dma_iommu_unmap_page,
.get_required_mask = dma_iommu_get_required_mask,
+ .mapping_error = dma_iommu_mapping_error,
};
EXPORT_SYMBOL(dma_iommu_ops);
OpenPOWER on IntegriCloud