aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/dma-nommu.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-04-17 22:02:10 +0200
committerChristoph Hellwig <hch@lst.de>2018-08-02 13:54:11 +0200
commita602915f5d0d9eff96a1d85b6f81e4921b52edfe (patch)
tree471aa4a6431fea4aa2eff5ce7e677976b5f964bd /arch/sh/kernel/dma-nommu.c
parentsh: introduce a sh_cacheop_vaddr helper (diff)
downloadlinux-dev-a602915f5d0d9eff96a1d85b6f81e4921b52edfe.tar.xz
linux-dev-a602915f5d0d9eff96a1d85b6f81e4921b52edfe.zip
sh: use dma_direct_ops for the CONFIG_DMA_COHERENT case
This is a slight change in behavior as we avoid the detour through the virtual mapping for the coherent allocator, but if this CPU really is coherent that should be the right thing to do. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Yoshinori Sato <ysato@users.sourceforge.jp>
Diffstat (limited to '')
-rw-r--r--arch/sh/kernel/dma-nommu.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/arch/sh/kernel/dma-nommu.c b/arch/sh/kernel/dma-nommu.c
index 79a9edafa5b0..d8689b1cb743 100644
--- a/arch/sh/kernel/dma-nommu.c
+++ b/arch/sh/kernel/dma-nommu.c
@@ -51,7 +51,6 @@ static int nommu_map_sg(struct device *dev, struct scatterlist *sg,
return nents;
}
-#ifdef CONFIG_DMA_NONCOHERENT
static void nommu_sync_single_for_device(struct device *dev, dma_addr_t addr,
size_t size, enum dma_data_direction dir)
{
@@ -67,16 +66,13 @@ static void nommu_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
for_each_sg(sg, s, nelems, i)
sh_sync_dma_for_device(sg_virt(s), s->length, dir);
}
-#endif
const struct dma_map_ops nommu_dma_ops = {
.alloc = dma_generic_alloc_coherent,
.free = dma_generic_free_coherent,
.map_page = nommu_map_page,
.map_sg = nommu_map_sg,
-#ifdef CONFIG_DMA_NONCOHERENT
.sync_single_for_device = nommu_sync_single_for_device,
.sync_sg_for_device = nommu_sync_sg_for_device,
-#endif
};
EXPORT_SYMBOL(nommu_dma_ops);