1 From: Felix Fietkau <nbd@openwrt.org>
2 Subject: [PATCH 1/2] MIPS: remove unnecessary platform dma helper functions
4 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
6 --- a/arch/mips/mm/dma-default.c
7 +++ b/arch/mips/mm/dma-default.c
8 @@ -289,7 +289,6 @@ static void mips_dma_sync_single_for_cpu
9 static void mips_dma_sync_single_for_device(struct device *dev,
10 dma_addr_t dma_handle, size_t size, enum dma_data_direction direction)
12 - plat_extra_sync_for_device(dev);
13 if (!plat_device_is_coherent(dev))
14 __dma_sync(dma_addr_to_page(dev, dma_handle),
15 dma_handle & ~PAGE_MASK, size, direction);
16 @@ -323,7 +322,7 @@ static void mips_dma_sync_sg_for_device(
18 int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
20 - return plat_dma_mapping_error(dev, dma_addr);
24 int mips_dma_supported(struct device *dev, u64 mask)
25 @@ -336,7 +335,6 @@ void dma_cache_sync(struct device *dev,
27 BUG_ON(direction == DMA_NONE);
29 - plat_extra_sync_for_device(dev);
30 if (!plat_device_is_coherent(dev))
31 __dma_sync_virtual(vaddr, size, direction);
33 --- a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
34 +++ b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
35 @@ -46,22 +46,11 @@ static inline int plat_dma_supported(str
39 -static inline void plat_extra_sync_for_device(struct device *dev)
44 static inline int plat_device_is_coherent(struct device *dev)
49 -static inline int plat_dma_mapping_error(struct device *dev,
50 - dma_addr_t dma_addr)
55 dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr);
56 phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr);
58 --- a/arch/mips/include/asm/mach-generic/dma-coherence.h
59 +++ b/arch/mips/include/asm/mach-generic/dma-coherence.h
60 @@ -47,16 +47,6 @@ static inline int plat_dma_supported(str
64 -static inline void plat_extra_sync_for_device(struct device *dev)
68 -static inline int plat_dma_mapping_error(struct device *dev,
69 - dma_addr_t dma_addr)
74 static inline int plat_device_is_coherent(struct device *dev)
76 #ifdef CONFIG_DMA_COHERENT
77 --- a/arch/mips/include/asm/mach-ip27/dma-coherence.h
78 +++ b/arch/mips/include/asm/mach-ip27/dma-coherence.h
79 @@ -58,16 +58,6 @@ static inline int plat_dma_supported(str
83 -static inline void plat_extra_sync_for_device(struct device *dev)
87 -static inline int plat_dma_mapping_error(struct device *dev,
88 - dma_addr_t dma_addr)
93 static inline int plat_device_is_coherent(struct device *dev)
95 return 1; /* IP27 non-cohernet mode is unsupported */
96 --- a/arch/mips/include/asm/mach-ip32/dma-coherence.h
97 +++ b/arch/mips/include/asm/mach-ip32/dma-coherence.h
98 @@ -80,17 +80,6 @@ static inline int plat_dma_supported(str
102 -static inline void plat_extra_sync_for_device(struct device *dev)
107 -static inline int plat_dma_mapping_error(struct device *dev,
108 - dma_addr_t dma_addr)
113 static inline int plat_device_is_coherent(struct device *dev)
115 return 0; /* IP32 is non-cohernet */
116 --- a/arch/mips/include/asm/mach-jazz/dma-coherence.h
117 +++ b/arch/mips/include/asm/mach-jazz/dma-coherence.h
118 @@ -48,16 +48,6 @@ static inline int plat_dma_supported(str
122 -static inline void plat_extra_sync_for_device(struct device *dev)
126 -static inline int plat_dma_mapping_error(struct device *dev,
127 - dma_addr_t dma_addr)
132 static inline int plat_device_is_coherent(struct device *dev)
135 --- a/arch/mips/include/asm/mach-loongson/dma-coherence.h
136 +++ b/arch/mips/include/asm/mach-loongson/dma-coherence.h
137 @@ -53,16 +53,6 @@ static inline int plat_dma_supported(str
141 -static inline void plat_extra_sync_for_device(struct device *dev)
145 -static inline int plat_dma_mapping_error(struct device *dev,
146 - dma_addr_t dma_addr)
151 static inline int plat_device_is_coherent(struct device *dev)
154 --- a/arch/mips/include/asm/mach-powertv/dma-coherence.h
155 +++ b/arch/mips/include/asm/mach-powertv/dma-coherence.h
156 @@ -99,16 +99,6 @@ static inline int plat_dma_supported(str
160 -static inline void plat_extra_sync_for_device(struct device *dev)
164 -static inline int plat_dma_mapping_error(struct device *dev,
165 - dma_addr_t dma_addr)
170 static inline int plat_device_is_coherent(struct device *dev)