kernel/3.1[02]: add Winbond W25X05 SPI flash support
[openwrt.git] / target / linux / generic / patches-3.12 / 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 @@ -52,23 +52,11 @@ static inline int plat_dma_supported(str
21         return 0;
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 -       return 0;
39 -}
40 -
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);
43  
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
47         return 1;
48  }
49  
50 -static inline void plat_extra_sync_for_device(struct device *dev)
51 -{
52 -}
53 -
54 -static inline int plat_dma_mapping_error(struct device *dev,
55 -                                        dma_addr_t dma_addr)
56 -{
57 -       return 0;
58 -}
59 -
60  static inline int plat_device_is_coherent(struct device *dev)
61  {
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
66         return 1;
67  }
68  
69 -static inline void plat_extra_sync_for_device(struct device *dev)
70 -{
71 -}
72 -
73 -static inline int plat_dma_mapping_error(struct device *dev,
74 -                                        dma_addr_t dma_addr)
75 -{
76 -       return 0;
77 -}
78 -
79  static inline int plat_device_is_coherent(struct device *dev)
80  {
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
85         return 1;
86  }
87  
88 -static inline void plat_extra_sync_for_device(struct device *dev)
89 -{
90 -       return;
91 -}
92 -
93 -static inline int plat_dma_mapping_error(struct device *dev,
94 -                                        dma_addr_t dma_addr)
95 -{
96 -       return 0;
97 -}
98 -
99  static inline int plat_device_is_coherent(struct device *dev)
100  {
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
105         return 1;
106  }
107  
108 -static inline void plat_extra_sync_for_device(struct device *dev)
109 -{
110 -}
111 -
112 -static inline int plat_dma_mapping_error(struct device *dev,
113 -                                        dma_addr_t dma_addr)
114 -{
115 -       return 0;
116 -}
117 -
118  static inline int plat_device_is_coherent(struct device *dev)
119  {
120         return 0;
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
124         return 1;
125  }
126  
127 -static inline void plat_extra_sync_for_device(struct device *dev)
128 -{
129 -}
130 -
131 -static inline int plat_dma_mapping_error(struct device *dev,
132 -                                        dma_addr_t dma_addr)
133 -{
134 -       return 0;
135 -}
136 -
137  static inline int plat_device_is_coherent(struct device *dev)
138  {
139         return 0;
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
143         return 1;
144  }
145  
146 -static inline void plat_extra_sync_for_device(struct device *dev)
147 -{
148 -}
149 -
150 -static inline int plat_dma_mapping_error(struct device *dev,
151 -                                        dma_addr_t dma_addr)
152 -{
153 -       return 0;
154 -}
155 -
156  static inline int plat_device_is_coherent(struct device *dev)
157  {
158         return 0;
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)
164  {
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(
170  
171  int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
172  {
173 -       return plat_dma_mapping_error(dev, dma_addr);
174 +       return 0;
175  }
176  
177  int mips_dma_supported(struct device *dev, u64 mask)
178 @@ -340,7 +339,6 @@ void dma_cache_sync(struct device *dev,
179  {
180         BUG_ON(direction == DMA_NONE);
181  
182 -       plat_extra_sync_for_device(dev);
183         if (!plat_device_is_coherent(dev))
184                 __dma_sync_virtual(vaddr, size, direction);
185  }