The two functions are equivalent as the arm32/64 specific bits are
handled in remap_range.

Combine them to reduce the duplication.

Signed-off-by: Ahmad Fatoum <a.fat...@pengutronix.de>
---
 arch/arm/cpu/mmu-common.c | 5 +++++
 arch/arm/cpu/mmu_32.c     | 5 -----
 arch/arm/cpu/mmu_64.c     | 5 -----
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/arch/arm/cpu/mmu-common.c b/arch/arm/cpu/mmu-common.c
index 1770c56b6eea..46982b00b7c5 100644
--- a/arch/arm/cpu/mmu-common.c
+++ b/arch/arm/cpu/mmu-common.c
@@ -74,6 +74,11 @@ void dma_free_coherent(struct device *dev,
        free(mem);
 }
 
+void *dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t 
*dma_handle)
+{
+       return dma_alloc_map(dev, size, dma_handle, MAP_WRITECOMBINE);
+}
+
 void zero_page_access(void)
 {
        remap_range(0x0, PAGE_SIZE, MAP_CACHED);
diff --git a/arch/arm/cpu/mmu_32.c b/arch/arm/cpu/mmu_32.c
index 7cf04ea9412a..63c412873ec8 100644
--- a/arch/arm/cpu/mmu_32.c
+++ b/arch/arm/cpu/mmu_32.c
@@ -684,11 +684,6 @@ void mmu_disable(void)
        __mmu_cache_off();
 }
 
-void *dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t 
*dma_handle)
-{
-       return dma_alloc_map(dev, size, dma_handle, MAP_WRITECOMBINE);
-}
-
 void mmu_early_enable(unsigned long membase, unsigned long memsize, unsigned 
long barebox_start)
 {
        uint32_t *ttb = (uint32_t *)arm_mem_ttb(membase + memsize);
diff --git a/arch/arm/cpu/mmu_64.c b/arch/arm/cpu/mmu_64.c
index edb1b34aca7f..f32cd9a0ac1a 100644
--- a/arch/arm/cpu/mmu_64.c
+++ b/arch/arm/cpu/mmu_64.c
@@ -373,11 +373,6 @@ void dma_flush_range(void *ptr, size_t size)
        v8_flush_dcache_range(start, end);
 }
 
-void *dma_alloc_writecombine(struct device *dev, size_t size, dma_addr_t 
*dma_handle)
-{
-       return dma_alloc_map(dev, size, dma_handle, MAP_WRITECOMBINE);
-}
-
 static void early_init_range(size_t total_level0_tables)
 {
        uint64_t *ttb = get_ttb();
-- 
2.39.5


Reply via email to