1 From 151c4e4a06b0b8d16c2fd392bb0e33868b12357f Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@openwrt.org>
3 Date: Mon, 12 Aug 2013 12:45:52 +0200
4 Subject: [PATCH] MIPS: remove unnecessary platform dma helper functions
6 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
8 arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h | 12 ------------
9 arch/mips/include/asm/mach-generic/dma-coherence.h | 10 ----------
10 arch/mips/include/asm/mach-ip27/dma-coherence.h | 10 ----------
11 arch/mips/include/asm/mach-ip32/dma-coherence.h | 11 -----------
12 arch/mips/include/asm/mach-jazz/dma-coherence.h | 10 ----------
13 arch/mips/include/asm/mach-loongson/dma-coherence.h | 10 ----------
14 arch/mips/include/asm/mach-powertv/dma-coherence.h | 10 ----------
15 arch/mips/mm/dma-default.c | 4 +---
16 8 files changed, 1 insertion(+), 76 deletions(-)
18 --- a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
19 +++ b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
20 @@ -52,23 +52,11 @@ static inline int plat_dma_supported(str
24 -static inline void plat_extra_sync_for_device(struct device *dev)
29 static inline int plat_device_is_coherent(struct device *dev)
34 -static inline int plat_dma_mapping_error(struct device *dev,
35 - dma_addr_t dma_addr)
41 dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr);
42 phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr);
44 --- a/arch/mips/include/asm/mach-generic/dma-coherence.h
45 +++ b/arch/mips/include/asm/mach-generic/dma-coherence.h
46 @@ -47,16 +47,6 @@ static inline int plat_dma_supported(str
50 -static inline void plat_extra_sync_for_device(struct device *dev)
54 -static inline int plat_dma_mapping_error(struct device *dev,
55 - dma_addr_t dma_addr)
60 static inline int plat_device_is_coherent(struct device *dev)
62 #ifdef CONFIG_DMA_COHERENT
63 --- a/arch/mips/include/asm/mach-ip27/dma-coherence.h
64 +++ b/arch/mips/include/asm/mach-ip27/dma-coherence.h
65 @@ -58,16 +58,6 @@ static inline int plat_dma_supported(str
69 -static inline void plat_extra_sync_for_device(struct device *dev)
73 -static inline int plat_dma_mapping_error(struct device *dev,
74 - dma_addr_t dma_addr)
79 static inline int plat_device_is_coherent(struct device *dev)
81 return 1; /* IP27 non-cohernet mode is unsupported */
82 --- a/arch/mips/include/asm/mach-ip32/dma-coherence.h
83 +++ b/arch/mips/include/asm/mach-ip32/dma-coherence.h
84 @@ -80,17 +80,6 @@ static inline int plat_dma_supported(str
88 -static inline void plat_extra_sync_for_device(struct device *dev)
93 -static inline int plat_dma_mapping_error(struct device *dev,
94 - dma_addr_t dma_addr)
99 static inline int plat_device_is_coherent(struct device *dev)
101 return 0; /* IP32 is non-cohernet */
102 --- a/arch/mips/include/asm/mach-jazz/dma-coherence.h
103 +++ b/arch/mips/include/asm/mach-jazz/dma-coherence.h
104 @@ -48,16 +48,6 @@ static inline int plat_dma_supported(str
108 -static inline void plat_extra_sync_for_device(struct device *dev)
112 -static inline int plat_dma_mapping_error(struct device *dev,
113 - dma_addr_t dma_addr)
118 static inline int plat_device_is_coherent(struct device *dev)
121 --- a/arch/mips/include/asm/mach-loongson/dma-coherence.h
122 +++ b/arch/mips/include/asm/mach-loongson/dma-coherence.h
123 @@ -53,16 +53,6 @@ static inline int plat_dma_supported(str
127 -static inline void plat_extra_sync_for_device(struct device *dev)
131 -static inline int plat_dma_mapping_error(struct device *dev,
132 - dma_addr_t dma_addr)
137 static inline int plat_device_is_coherent(struct device *dev)
140 --- a/arch/mips/include/asm/mach-powertv/dma-coherence.h
141 +++ b/arch/mips/include/asm/mach-powertv/dma-coherence.h
142 @@ -99,16 +99,6 @@ static inline int plat_dma_supported(str
146 -static inline void plat_extra_sync_for_device(struct device *dev)
150 -static inline int plat_dma_mapping_error(struct device *dev,
151 - dma_addr_t dma_addr)
156 static inline int plat_device_is_coherent(struct device *dev)
159 --- a/arch/mips/mm/dma-default.c
160 +++ b/arch/mips/mm/dma-default.c
161 @@ -297,7 +297,6 @@ static void mips_dma_sync_single_for_cpu
162 static void mips_dma_sync_single_for_device(struct device *dev,
163 dma_addr_t dma_handle, size_t size, enum dma_data_direction direction)
165 - plat_extra_sync_for_device(dev);
166 if (!plat_device_is_coherent(dev))
167 __dma_sync(dma_addr_to_page(dev, dma_handle),
168 dma_handle & ~PAGE_MASK, size, direction);
169 @@ -327,7 +326,7 @@ static void mips_dma_sync_sg_for_device(
171 int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
173 - return plat_dma_mapping_error(dev, dma_addr);
177 int mips_dma_supported(struct device *dev, u64 mask)
178 @@ -340,7 +339,6 @@ void dma_cache_sync(struct device *dev,
180 BUG_ON(direction == DMA_NONE);
182 - plat_extra_sync_for_device(dev);
183 if (!plat_device_is_coherent(dev))
184 __dma_sync_virtual(vaddr, size, direction);