summaryrefslogtreecommitdiff
path: root/include/linux/dma-map-ops.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-10-07 11:04:08 +0200
committerChristoph Hellwig <hch@lst.de>2020-10-07 11:09:20 +0200
commit849facea92fa68d9292f9b06d7c4ee9e7a06b8dc (patch)
treed7225bfe41003dc1ea8105e920bcf938dcd66d6e /include/linux/dma-map-ops.h
parent5b138c534fda57c2ebc1e6de72578aa1d70788a6 (diff)
dma-direct: simplify the DMA_ATTR_NO_KERNEL_MAPPING handling
Use and entirely separate code path for the DMA_ATTR_NO_KERNEL_MAPPING path. This avoids any confusion about the ret type, and avoids lots of attr checks and helpers that can be significantly simplified now. It also ensures that common handling is applied to architetures still using the arch alloc/free hooks. Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/dma-map-ops.h')
-rw-r--r--include/linux/dma-map-ops.h13
1 files changed, 0 insertions, 13 deletions
diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h
index 33c6e24707a9..8029f7e04145 100644
--- a/include/linux/dma-map-ops.h
+++ b/include/linux/dma-map-ops.h
@@ -219,19 +219,6 @@ static inline bool dev_is_dma_coherent(struct device *dev)
}
#endif /* CONFIG_ARCH_HAS_DMA_COHERENCE_H */
-/*
- * Check if an allocation needs to be marked uncached to be coherent.
- */
-static __always_inline bool dma_alloc_need_uncached(struct device *dev,
- unsigned long attrs)
-{
- if (dev_is_dma_coherent(dev))
- return false;
- if (attrs & DMA_ATTR_NO_KERNEL_MAPPING)
- return false;
- return true;
-}
-
void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle,
gfp_t gfp, unsigned long attrs);
void arch_dma_free(struct device *dev, size_t size, void *cpu_addr,