aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dma-direct.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-11-12 17:06:04 +0100
committerChristoph Hellwig <hch@lst.de>2019-11-20 20:31:40 +0100
commit130c1ccbf55330b55e82612a6e54eebb82c9d746 (patch)
treed61b03639384aa3357871b756082ff6966dcbf38 /include/linux/dma-direct.h
parentdma-mapping: drop the dev argument to arch_sync_dma_for_* (diff)
downloadlinux-dev-130c1ccbf55330b55e82612a6e54eebb82c9d746.tar.xz
linux-dev-130c1ccbf55330b55e82612a6e54eebb82c9d746.zip
dma-direct: unify the dma_capable definitions
Currently each architectures that wants to override dma_to_phys and phys_to_dma also has to provide dma_capable. But there isn't really any good reason for that. powerpc and mips just have copies of the generic one minus the latests fix, and the arm one was the inspiration for said fix, but misses the bus_dma_mask handling. Make all architectures use the generic version instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc) Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Diffstat (limited to 'include/linux/dma-direct.h')
-rw-r--r--include/linux/dma-direct.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/dma-direct.h b/include/linux/dma-direct.h
index 6db863c3eb93..991f8aa2676e 100644
--- a/include/linux/dma-direct.h
+++ b/include/linux/dma-direct.h
@@ -24,6 +24,7 @@ static inline phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t dev_addr)
return paddr + ((phys_addr_t)dev->dma_pfn_offset << PAGE_SHIFT);
}
+#endif /* !CONFIG_ARCH_HAS_PHYS_TO_DMA */
static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
{
@@ -38,7 +39,6 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
return end <= min_not_zero(*dev->dma_mask, dev->bus_dma_mask);
}
-#endif /* !CONFIG_ARCH_HAS_PHYS_TO_DMA */
#ifdef CONFIG_ARCH_HAS_FORCE_DMA_UNENCRYPTED
bool force_dma_unencrypted(struct device *dev);