summaryrefslogtreecommitdiff
path: root/include/linux/dma-map-ops.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-02-10 10:56:39 +0100
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2021-02-13 09:51:45 +0100
commit6d4e9a8efe3d59f31367d79e970c2f328da139a4 (patch)
tree7e236f45053e397f6810c2494dda6c251b19a5bc /include/linux/dma-map-ops.h
parent14ac09a65e19528ca05df56f8e36a4a8d4949795 (diff)
driver core: lift dma_default_coherent into common code
Lift the dma_default_coherent variable from the mips architecture code to the driver core. This allows an architecture to sdefault all device to be DMA coherent at run time, even if the kernel is build with support for DMA noncoherent device. By allowing device_initialize to set the ->dma_coherent field to this default the amount of arch hooks required for this behavior can be greatly reduced. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'include/linux/dma-map-ops.h')
-rw-r--r--include/linux/dma-map-ops.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h
index 70fcd0f610ea..1e98b8c1e055 100644
--- a/include/linux/dma-map-ops.h
+++ b/include/linux/dma-map-ops.h
@@ -229,11 +229,10 @@ bool dma_free_from_pool(struct device *dev, void *start, size_t size);
int dma_direct_set_offset(struct device *dev, phys_addr_t cpu_start,
dma_addr_t dma_start, u64 size);
-#ifdef CONFIG_ARCH_HAS_DMA_COHERENCE_H
-#include <asm/dma-coherence.h>
-#elif defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \
+#if defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \
defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU) || \
defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
+extern bool dma_default_coherent;
static inline bool dev_is_dma_coherent(struct device *dev)
{
return dev->dma_coherent;