[PATCH 48/78] dma: Use dma_addr_t as type for DMA addresses
Sascha Hauer
s.hauer at pengutronix.de
Fri Mar 16 05:53:24 PDT 2018
DMA addresses are not necessarily the same as unsigned long. Fix
the type for the dma_sync_single_* operations.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
arch/arm/cpu/mmu.c | 4 ++--
arch/mips/lib/dma-default.c | 4 ++--
include/dma.h | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm/cpu/mmu.c b/arch/arm/cpu/mmu.c
index de0b631981..fc71cf03cd 100644
--- a/arch/arm/cpu/mmu.c
+++ b/arch/arm/cpu/mmu.c
@@ -575,7 +575,7 @@ void dma_free_coherent(void *mem, dma_addr_t dma_handle, size_t size)
free(mem);
}
-void dma_sync_single_for_cpu(unsigned long address, size_t size,
+void dma_sync_single_for_cpu(dma_addr_t address, size_t size,
enum dma_data_direction dir)
{
if (dir != DMA_TO_DEVICE) {
@@ -585,7 +585,7 @@ void dma_sync_single_for_cpu(unsigned long address, size_t size,
}
}
-void dma_sync_single_for_device(unsigned long address, size_t size,
+void dma_sync_single_for_device(dma_addr_t address, size_t size,
enum dma_data_direction dir)
{
if (dir == DMA_FROM_DEVICE) {
diff --git a/arch/mips/lib/dma-default.c b/arch/mips/lib/dma-default.c
index 9b2fe7d410..71c1e423b7 100644
--- a/arch/mips/lib/dma-default.c
+++ b/arch/mips/lib/dma-default.c
@@ -44,13 +44,13 @@ static inline void __dma_sync_mips(void *addr, size_t size,
}
#endif
-void dma_sync_single_for_cpu(unsigned long address, size_t size,
+void dma_sync_single_for_cpu(dma_addr_t address, size_t size,
enum dma_data_direction dir)
{
__dma_sync_mips(address, size, dir);
}
-void dma_sync_single_for_device(unsigned long address, size_t size,
+void dma_sync_single_for_device(dma_addr_t address, size_t size,
enum dma_data_direction dir)
{
__dma_sync_mips(address, size, dir);
diff --git a/include/dma.h b/include/dma.h
index 4d31797968..29d94c0a52 100644
--- a/include/dma.h
+++ b/include/dma.h
@@ -31,10 +31,10 @@ static inline void dma_free(void *mem)
#endif
/* streaming DMA - implement the below calls to support HAS_DMA */
-void dma_sync_single_for_cpu(unsigned long address, size_t size,
+void dma_sync_single_for_cpu(dma_addr_t address, size_t size,
enum dma_data_direction dir);
-void dma_sync_single_for_device(unsigned long address, size_t size,
+void dma_sync_single_for_device(dma_addr_t address, size_t size,
enum dma_data_direction dir);
void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle);
--
2.16.1
More information about the barebox
mailing list