aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/dma-mapping.h
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/include/asm/dma-mapping.h
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 'arch/sh/include/asm/dma-mapping.h')
-rw-r--r--arch/sh/include/asm/dma-mapping.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h
index 149e71f95be7..1ebc6a4eb1c5 100644
--- a/arch/sh/include/asm/dma-mapping.h
+++ b/arch/sh/include/asm/dma-mapping.h
@@ -6,7 +6,11 @@ extern const struct dma_map_ops nommu_dma_ops;
static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
{
+#ifdef CONFIG_DMA_NONCOHERENT
return &nommu_dma_ops;
+#else
+ return &dma_direct_ops;
+#endif
}
extern void *dma_generic_alloc_coherent(struct device *dev, size_t size,