aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2010-08-10 21:03:25 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-11 11:59:21 -0400
commit3b9c6c11f519718d618f5d7c9508daf78b207f6f (patch)
tree6c99992e25b9305fbe3977dff30f5eeb445f25e0 /arch
parentd80e0d96a328cc864a1cb359f545a6ed0c61812d (diff)
dma-mapping: remove dma_is_consistent API
Architectures implement dma_is_consistent() in different ways (some misinterpret the definition of API in DMA-API.txt). So it hasn't been so useful for drivers. We have only one user of the API in tree. Unlikely out-of-tree drivers use the API. Even if we fix dma_is_consistent() in some architectures, it doesn't look useful at all. It was invented long ago for some old systems that can't allocate coherent memory at all. It's better to export only APIs that are definitely necessary for drivers. Let's remove this API. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: <linux-arch@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/include/asm/dma-mapping.h1
-rw-r--r--arch/arm/include/asm/dma-mapping.h5
-rw-r--r--arch/avr32/include/asm/dma-mapping.h5
-rw-r--r--arch/blackfin/include/asm/dma-mapping.h1
-rw-r--r--arch/cris/include/asm/dma-mapping.h2
-rw-r--r--arch/frv/include/asm/dma-mapping.h2
-rw-r--r--arch/ia64/include/asm/dma-mapping.h2
-rw-r--r--arch/m68k/include/asm/dma-mapping.h5
-rw-r--r--arch/microblaze/include/asm/dma-mapping.h1
-rw-r--r--arch/mips/include/asm/dma-mapping.h2
-rw-r--r--arch/mips/mm/dma-default.c7
-rw-r--r--arch/mn10300/include/asm/dma-mapping.h2
-rw-r--r--arch/parisc/include/asm/dma-mapping.h6
-rw-r--r--arch/powerpc/include/asm/dma-mapping.h5
-rw-r--r--arch/sh/include/asm/dma-mapping.h6
-rw-r--r--arch/sparc/include/asm/dma-mapping.h1
-rw-r--r--arch/tile/include/asm/dma-mapping.h2
-rw-r--r--arch/um/include/asm/dma-mapping.h1
-rw-r--r--arch/x86/include/asm/dma-mapping.h1
-rw-r--r--arch/xtensa/include/asm/dma-mapping.h2
20 files changed, 0 insertions, 59 deletions
diff --git a/arch/alpha/include/asm/dma-mapping.h b/arch/alpha/include/asm/dma-mapping.h
index b3423d96acc7..4567aca6fdd6 100644
--- a/arch/alpha/include/asm/dma-mapping.h
+++ b/arch/alpha/include/asm/dma-mapping.h
@@ -41,7 +41,6 @@ static inline int dma_set_mask(struct device *dev, u64 mask)
41 41
42#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 42#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
43#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 43#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
44#define dma_is_consistent(d, h) (1)
45 44
46#define dma_cache_sync(dev, va, size, dir) ((void)0) 45#define dma_cache_sync(dev, va, size, dir) ((void)0)
47 46
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
index f4a996d5ae96..c568da7dcae4 100644
--- a/arch/arm/include/asm/dma-mapping.h
+++ b/arch/arm/include/asm/dma-mapping.h
@@ -144,11 +144,6 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
144 return 0; 144 return 0;
145} 145}
146 146
147static inline int dma_is_consistent(struct device *dev, dma_addr_t handle)
148{
149 return !!arch_is_coherent();
150}
151
152/* 147/*
153 * DMA errors are defined by all-bits-set in the DMA address. 148 * DMA errors are defined by all-bits-set in the DMA address.
154 */ 149 */
diff --git a/arch/avr32/include/asm/dma-mapping.h b/arch/avr32/include/asm/dma-mapping.h
index af6b81655074..aaf5199d8fcb 100644
--- a/arch/avr32/include/asm/dma-mapping.h
+++ b/arch/avr32/include/asm/dma-mapping.h
@@ -336,9 +336,4 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
336#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 336#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
337#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 337#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
338 338
339static inline int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)
340{
341 return 1;
342}
343
344#endif /* __ASM_AVR32_DMA_MAPPING_H */ 339#endif /* __ASM_AVR32_DMA_MAPPING_H */
diff --git a/arch/blackfin/include/asm/dma-mapping.h b/arch/blackfin/include/asm/dma-mapping.h
index 6694a0f55de9..bbf461076a0a 100644
--- a/arch/blackfin/include/asm/dma-mapping.h
+++ b/arch/blackfin/include/asm/dma-mapping.h
@@ -21,7 +21,6 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
21#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 21#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
22#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 22#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
23#define dma_supported(d, m) (1) 23#define dma_supported(d, m) (1)
24#define dma_is_consistent(d, h) (1)
25 24
26static inline int 25static inline int
27dma_set_mask(struct device *dev, u64 dma_mask) 26dma_set_mask(struct device *dev, u64 dma_mask)
diff --git a/arch/cris/include/asm/dma-mapping.h b/arch/cris/include/asm/dma-mapping.h
index fc30fd0b2a04..8588b2ccf854 100644
--- a/arch/cris/include/asm/dma-mapping.h
+++ b/arch/cris/include/asm/dma-mapping.h
@@ -152,8 +152,6 @@ dma_set_mask(struct device *dev, u64 mask)
152 return 0; 152 return 0;
153} 153}
154 154
155#define dma_is_consistent(d, h) (1)
156
157static inline void 155static inline void
158dma_cache_sync(struct device *dev, void *vaddr, size_t size, 156dma_cache_sync(struct device *dev, void *vaddr, size_t size,
159 enum dma_data_direction direction) 157 enum dma_data_direction direction)
diff --git a/arch/frv/include/asm/dma-mapping.h b/arch/frv/include/asm/dma-mapping.h
index 7b05ce14177e..dfb811002c64 100644
--- a/arch/frv/include/asm/dma-mapping.h
+++ b/arch/frv/include/asm/dma-mapping.h
@@ -125,8 +125,6 @@ int dma_set_mask(struct device *dev, u64 mask)
125 return 0; 125 return 0;
126} 126}
127 127
128#define dma_is_consistent(d, h) (1)
129
130static inline 128static inline
131void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 129void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
132 enum dma_data_direction direction) 130 enum dma_data_direction direction)
diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h
index 8d52deed3750..a2e7368a0150 100644
--- a/arch/ia64/include/asm/dma-mapping.h
+++ b/arch/ia64/include/asm/dma-mapping.h
@@ -97,6 +97,4 @@ dma_cache_sync (struct device *dev, void *vaddr, size_t size,
97 mb(); 97 mb();
98} 98}
99 99
100#define dma_is_consistent(d, h) (1) /* all we do is coherent memory... */
101
102#endif /* _ASM_IA64_DMA_MAPPING_H */ 100#endif /* _ASM_IA64_DMA_MAPPING_H */
diff --git a/arch/m68k/include/asm/dma-mapping.h b/arch/m68k/include/asm/dma-mapping.h
index a1ae732c7247..17f7a45948ea 100644
--- a/arch/m68k/include/asm/dma-mapping.h
+++ b/arch/m68k/include/asm/dma-mapping.h
@@ -16,11 +16,6 @@ static inline int dma_set_mask(struct device *dev, u64 mask)
16 return 0; 16 return 0;
17} 17}
18 18
19static inline int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)
20{
21 return 0;
22}
23
24extern void *dma_alloc_coherent(struct device *, size_t, 19extern void *dma_alloc_coherent(struct device *, size_t,
25 dma_addr_t *, gfp_t); 20 dma_addr_t *, gfp_t);
26extern void dma_free_coherent(struct device *, size_t, 21extern void dma_free_coherent(struct device *, size_t,
diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h
index 21df7cbae65e..8fbb0ec10233 100644
--- a/arch/microblaze/include/asm/dma-mapping.h
+++ b/arch/microblaze/include/asm/dma-mapping.h
@@ -106,7 +106,6 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
106 106
107#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 107#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
108#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 108#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
109#define dma_is_consistent(d, h) (1)
110 109
111static inline void *dma_alloc_coherent(struct device *dev, size_t size, 110static inline void *dma_alloc_coherent(struct device *dev, size_t size,
112 dma_addr_t *dma_handle, gfp_t flag) 111 dma_addr_t *dma_handle, gfp_t flag)
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h
index d724a15f0438..18fbf7af8e93 100644
--- a/arch/mips/include/asm/dma-mapping.h
+++ b/arch/mips/include/asm/dma-mapping.h
@@ -62,8 +62,6 @@ dma_set_mask(struct device *dev, u64 mask)
62 return 0; 62 return 0;
63} 63}
64 64
65extern int dma_is_consistent(struct device *dev, dma_addr_t dma_addr);
66
67extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 65extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
68 enum dma_data_direction direction); 66 enum dma_data_direction direction);
69 67
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index 9547bc0cf188..7ba890860d98 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -357,13 +357,6 @@ int dma_supported(struct device *dev, u64 mask)
357 357
358EXPORT_SYMBOL(dma_supported); 358EXPORT_SYMBOL(dma_supported);
359 359
360int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)
361{
362 return plat_device_is_coherent(dev);
363}
364
365EXPORT_SYMBOL(dma_is_consistent);
366
367void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 360void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
368 enum dma_data_direction direction) 361 enum dma_data_direction direction)
369{ 362{
diff --git a/arch/mn10300/include/asm/dma-mapping.h b/arch/mn10300/include/asm/dma-mapping.h
index 8d452a657795..c1be4397b1ed 100644
--- a/arch/mn10300/include/asm/dma-mapping.h
+++ b/arch/mn10300/include/asm/dma-mapping.h
@@ -161,8 +161,6 @@ int dma_set_mask(struct device *dev, u64 mask)
161 return 0; 161 return 0;
162} 162}
163 163
164#define dma_is_consistent(d) (1)
165
166static inline 164static inline
167void dma_cache_sync(void *vaddr, size_t size, 165void dma_cache_sync(void *vaddr, size_t size,
168 enum dma_data_direction direction) 166 enum dma_data_direction direction)
diff --git a/arch/parisc/include/asm/dma-mapping.h b/arch/parisc/include/asm/dma-mapping.h
index 44d3f62ccf9d..4ef73b09b168 100644
--- a/arch/parisc/include/asm/dma-mapping.h
+++ b/arch/parisc/include/asm/dma-mapping.h
@@ -184,12 +184,6 @@ dma_set_mask(struct device *dev, u64 mask)
184 return 0; 184 return 0;
185} 185}
186 186
187static inline int
188dma_is_consistent(struct device *dev, dma_addr_t dma_addr)
189{
190 return (hppa_dma_ops->dma_sync_single_for_cpu == NULL);
191}
192
193static inline void 187static inline void
194dma_cache_sync(struct device *dev, void *vaddr, size_t size, 188dma_cache_sync(struct device *dev, void *vaddr, size_t size,
195 enum dma_data_direction direction) 189 enum dma_data_direction direction)
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index a77ba280af04..8c9c6ad2004e 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -209,11 +209,6 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)
209 209
210#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 210#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
211#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 211#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
212#ifdef CONFIG_NOT_COHERENT_CACHE
213#define dma_is_consistent(d, h) (0)
214#else
215#define dma_is_consistent(d, h) (1)
216#endif
217 212
218static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, 213static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
219 enum dma_data_direction direction) 214 enum dma_data_direction direction)
diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h
index 6bb5cc9decf8..1a73c3e759a7 100644
--- a/arch/sh/include/asm/dma-mapping.h
+++ b/arch/sh/include/asm/dma-mapping.h
@@ -42,12 +42,6 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
42#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 42#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
43#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 43#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
44 44
45#ifdef CONFIG_DMA_COHERENT
46#define dma_is_consistent(d, h) (1)
47#else
48#define dma_is_consistent(d, h) (0)
49#endif
50
51static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 45static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
52{ 46{
53 struct dma_map_ops *ops = get_dma_ops(dev); 47 struct dma_map_ops *ops = get_dma_ops(dev);
diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h
index 74db853ec2cf..8c0e4f7bb204 100644
--- a/arch/sparc/include/asm/dma-mapping.h
+++ b/arch/sparc/include/asm/dma-mapping.h
@@ -11,7 +11,6 @@ extern int dma_supported(struct device *dev, u64 mask);
11 11
12#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 12#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
13#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 13#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
14#define dma_is_consistent(d, h) (1)
15 14
16extern struct dma_map_ops *dma_ops, pci32_dma_ops; 15extern struct dma_map_ops *dma_ops, pci32_dma_ops;
17extern struct bus_type pci_bus_type; 16extern struct bus_type pci_bus_type;
diff --git a/arch/tile/include/asm/dma-mapping.h b/arch/tile/include/asm/dma-mapping.h
index 1326b910fec6..15e1dceecc64 100644
--- a/arch/tile/include/asm/dma-mapping.h
+++ b/arch/tile/include/asm/dma-mapping.h
@@ -90,6 +90,4 @@ dma_set_mask(struct device *dev, u64 mask)
90 return 0; 90 return 0;
91} 91}
92 92
93#define dma_is_consistent(d, h) (1)
94
95#endif /* _ASM_TILE_DMA_MAPPING_H */ 93#endif /* _ASM_TILE_DMA_MAPPING_H */
diff --git a/arch/um/include/asm/dma-mapping.h b/arch/um/include/asm/dma-mapping.h
index b948c14a7867..17a2cb5a4178 100644
--- a/arch/um/include/asm/dma-mapping.h
+++ b/arch/um/include/asm/dma-mapping.h
@@ -94,7 +94,6 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
94 94
95#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 95#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
96#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 96#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
97#define dma_is_consistent(d, h) (1)
98 97
99static inline int 98static inline int
100dma_get_cache_alignment(void) 99dma_get_cache_alignment(void)
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h
index f9c67e83f648..d4c419f883a0 100644
--- a/arch/x86/include/asm/dma-mapping.h
+++ b/arch/x86/include/asm/dma-mapping.h
@@ -54,7 +54,6 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
54 54
55#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) 55#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
56#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) 56#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
57#define dma_is_consistent(d, h) (1)
58 57
59extern int dma_supported(struct device *hwdev, u64 mask); 58extern int dma_supported(struct device *hwdev, u64 mask);
60extern int dma_set_mask(struct device *dev, u64 mask); 59extern int dma_set_mask(struct device *dev, u64 mask);
diff --git a/arch/xtensa/include/asm/dma-mapping.h b/arch/xtensa/include/asm/dma-mapping.h
index 7104f2f9823e..492c95790ad5 100644
--- a/arch/xtensa/include/asm/dma-mapping.h
+++ b/arch/xtensa/include/asm/dma-mapping.h
@@ -161,8 +161,6 @@ dma_set_mask(struct device *dev, u64 mask)
161 return 0; 161 return 0;
162} 162}
163 163
164#define dma_is_consistent(d, h) (1)
165
166static inline void 164static inline void
167dma_cache_sync(struct device *dev, void *vaddr, size_t size, 165dma_cache_sync(struct device *dev, void *vaddr, size_t size,
168 enum dma_data_direction direction) 166 enum dma_data_direction direction)