1d53a8d67272107258d4623a0c4b7aa9ad23a85e
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-3.10 / 130-mips_remove_plat_dma_functions.patch
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
5
6 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
7 ---
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(-)
17
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 @@ -46,22 +46,11 @@ static inline int plat_dma_supported(str
21 BUG();
22 }
23
24 -static inline void plat_extra_sync_for_device(struct device *dev)
25 -{
26 - BUG();
27 -}
28 -
29 static inline int plat_device_is_coherent(struct device *dev)
30 {
31 return 1;
32 }
33
34 -static inline int plat_dma_mapping_error(struct device *dev,
35 - dma_addr_t dma_addr)
36 -{
37 - BUG();
38 -}
39 -
40 dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr);
41 phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr);
42
43 --- a/arch/mips/include/asm/mach-generic/dma-coherence.h
44 +++ b/arch/mips/include/asm/mach-generic/dma-coherence.h
45 @@ -47,16 +47,6 @@ static inline int plat_dma_supported(str
46 return 1;
47 }
48
49 -static inline void plat_extra_sync_for_device(struct device *dev)
50 -{
51 -}
52 -
53 -static inline int plat_dma_mapping_error(struct device *dev,
54 - dma_addr_t dma_addr)
55 -{
56 - return 0;
57 -}
58 -
59 static inline int plat_device_is_coherent(struct device *dev)
60 {
61 #ifdef CONFIG_DMA_COHERENT
62 --- a/arch/mips/include/asm/mach-ip27/dma-coherence.h
63 +++ b/arch/mips/include/asm/mach-ip27/dma-coherence.h
64 @@ -58,16 +58,6 @@ static inline int plat_dma_supported(str
65 return 1;
66 }
67
68 -static inline void plat_extra_sync_for_device(struct device *dev)
69 -{
70 -}
71 -
72 -static inline int plat_dma_mapping_error(struct device *dev,
73 - dma_addr_t dma_addr)
74 -{
75 - return 0;
76 -}
77 -
78 static inline int plat_device_is_coherent(struct device *dev)
79 {
80 return 1; /* IP27 non-cohernet mode is unsupported */
81 --- a/arch/mips/include/asm/mach-ip32/dma-coherence.h
82 +++ b/arch/mips/include/asm/mach-ip32/dma-coherence.h
83 @@ -80,17 +80,6 @@ static inline int plat_dma_supported(str
84 return 1;
85 }
86
87 -static inline void plat_extra_sync_for_device(struct device *dev)
88 -{
89 - return;
90 -}
91 -
92 -static inline int plat_dma_mapping_error(struct device *dev,
93 - dma_addr_t dma_addr)
94 -{
95 - return 0;
96 -}
97 -
98 static inline int plat_device_is_coherent(struct device *dev)
99 {
100 return 0; /* IP32 is non-cohernet */
101 --- a/arch/mips/include/asm/mach-jazz/dma-coherence.h
102 +++ b/arch/mips/include/asm/mach-jazz/dma-coherence.h
103 @@ -48,16 +48,6 @@ static inline int plat_dma_supported(str
104 return 1;
105 }
106
107 -static inline void plat_extra_sync_for_device(struct device *dev)
108 -{
109 -}
110 -
111 -static inline int plat_dma_mapping_error(struct device *dev,
112 - dma_addr_t dma_addr)
113 -{
114 - return 0;
115 -}
116 -
117 static inline int plat_device_is_coherent(struct device *dev)
118 {
119 return 0;
120 --- a/arch/mips/include/asm/mach-loongson/dma-coherence.h
121 +++ b/arch/mips/include/asm/mach-loongson/dma-coherence.h
122 @@ -53,16 +53,6 @@ static inline int plat_dma_supported(str
123 return 1;
124 }
125
126 -static inline void plat_extra_sync_for_device(struct device *dev)
127 -{
128 -}
129 -
130 -static inline int plat_dma_mapping_error(struct device *dev,
131 - dma_addr_t dma_addr)
132 -{
133 - return 0;
134 -}
135 -
136 static inline int plat_device_is_coherent(struct device *dev)
137 {
138 return 0;
139 --- a/arch/mips/include/asm/mach-powertv/dma-coherence.h
140 +++ b/arch/mips/include/asm/mach-powertv/dma-coherence.h
141 @@ -99,16 +99,6 @@ static inline int plat_dma_supported(str
142 return 1;
143 }
144
145 -static inline void plat_extra_sync_for_device(struct device *dev)
146 -{
147 -}
148 -
149 -static inline int plat_dma_mapping_error(struct device *dev,
150 - dma_addr_t dma_addr)
151 -{
152 - return 0;
153 -}
154 -
155 static inline int plat_device_is_coherent(struct device *dev)
156 {
157 return 0;
158 --- a/arch/mips/mm/dma-default.c
159 +++ b/arch/mips/mm/dma-default.c
160 @@ -289,7 +289,6 @@ static void mips_dma_sync_single_for_cpu
161 static void mips_dma_sync_single_for_device(struct device *dev,
162 dma_addr_t dma_handle, size_t size, enum dma_data_direction direction)
163 {
164 - plat_extra_sync_for_device(dev);
165 if (!plat_device_is_coherent(dev))
166 __dma_sync(dma_addr_to_page(dev, dma_handle),
167 dma_handle & ~PAGE_MASK, size, direction);
168 @@ -323,7 +322,7 @@ static void mips_dma_sync_sg_for_device(
169
170 int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
171 {
172 - return plat_dma_mapping_error(dev, dma_addr);
173 + return 0;
174 }
175
176 int mips_dma_supported(struct device *dev, u64 mask)
177 @@ -336,7 +335,6 @@ void dma_cache_sync(struct device *dev,
178 {
179 BUG_ON(direction == DMA_NONE);
180
181 - plat_extra_sync_for_device(dev);
182 if (!plat_device_is_coherent(dev))
183 __dma_sync_virtual(vaddr, size, direction);
184 }