Commit fe4e5efa authored by Jiaxun Yang's avatar Jiaxun Yang Committed by Christoph Hellwig

dma-mapping: provide a fallback dma_default_coherent

dma_default_coherent was decleared unconditionally at kernel/dma/mapping.c
but only decleared when any of non-coherent options is enabled in
dma-map-ops.h.

Guard the declaration in mapping.c with non-coherent options and provide
a fallback definition.
Signed-off-by: default avatarJiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent b31507dc
...@@ -269,6 +269,8 @@ static inline bool dev_is_dma_coherent(struct device *dev) ...@@ -269,6 +269,8 @@ static inline bool dev_is_dma_coherent(struct device *dev)
return dev->dma_coherent; return dev->dma_coherent;
} }
#else #else
#define dma_default_coherent true
static inline bool dev_is_dma_coherent(struct device *dev) static inline bool dev_is_dma_coherent(struct device *dev)
{ {
return true; return true;
......
...@@ -17,7 +17,11 @@ ...@@ -17,7 +17,11 @@
#include "debug.h" #include "debug.h"
#include "direct.h" #include "direct.h"
#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)
bool dma_default_coherent; bool dma_default_coherent;
#endif
/* /*
* Managed DMA API * Managed DMA API
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment