[PATCH v2 03/27] MIPS: change dma_alloc/free_coherent to common prototypes
Lucas Stach
dev at lynxeye.de
Thu Mar 5 13:49:54 PST 2015
Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
arch/mips/include/asm/dma-mapping.h | 6 ++++--
arch/mips/include/asm/dma.h | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h
index 555efa5..6395112 100644
--- a/arch/mips/include/asm/dma-mapping.h
+++ b/arch/mips/include/asm/dma-mapping.h
@@ -12,12 +12,14 @@ static inline void *dma_alloc_coherent(size_t size, dma_addr_t *dma_handle)
ret = xmemalign(PAGE_SIZE, size);
- *dma_handle = CPHYSADDR(ret);
+ if (dma_handle)
+ *dma_handle = CPHYSADDR(ret);
return (void *)CKSEG1ADDR(ret);
}
-static inline void dma_free_coherent(void *vaddr)
+static inline void dma_free_coherent(void *vaddr, dma_addr_t dma_handle,
+ size_t size)
{
free(vaddr);
}
diff --git a/arch/mips/include/asm/dma.h b/arch/mips/include/asm/dma.h
index 27d269f..30a58c7 100644
--- a/arch/mips/include/asm/dma.h
+++ b/arch/mips/include/asm/dma.h
@@ -8,6 +8,6 @@
#ifndef __ASM_DMA_H
#define __ASM_DMA_H
-/* empty */
+#include "asm/dma-mapping.h"
#endif /* __ASM_DMA_H */
--
2.1.0
More information about the barebox
mailing list