diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-07-24 04:10:55 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-08-01 17:25:04 -0400 |
commit | 1234e3fda9aa24b2d650bbcd9ef09d5f6a12dc86 (patch) | |
tree | ad30b68bfd5c594499e9670dab32d4f2a2eb8a6d | |
parent | 9ac87c5a0b19417f925dc61cac7198d872159a2c (diff) |
ARM: reduce visibility of dmac_* functions
The dmac_* functions are private to the ARM DMA API implementation, and
should not be used by drivers. In order to discourage their use, remove
their prototypes and macros from asm/*.h.
We have to leave dmac_flush_range() behind as Exynos and MSM IOMMU code
use these; once these sites are fixed, this can be moved also.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/include/asm/cacheflush.h | 4 | ||||
-rw-r--r-- | arch/arm/include/asm/glue-cache.h | 2 | ||||
-rw-r--r-- | arch/arm/mm/dma-mapping.c | 1 | ||||
-rw-r--r-- | arch/arm/mm/dma.h | 32 |
4 files changed, 33 insertions, 6 deletions
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h index 4812cda8fd17..c5230a44eeca 100644 --- a/arch/arm/include/asm/cacheflush.h +++ b/arch/arm/include/asm/cacheflush.h | |||
@@ -140,8 +140,6 @@ extern struct cpu_cache_fns cpu_cache; | |||
140 | * is visible to DMA, or data written by DMA to system memory is | 140 | * is visible to DMA, or data written by DMA to system memory is |
141 | * visible to the CPU. | 141 | * visible to the CPU. |
142 | */ | 142 | */ |
143 | #define dmac_map_area cpu_cache.dma_map_area | ||
144 | #define dmac_unmap_area cpu_cache.dma_unmap_area | ||
145 | #define dmac_flush_range cpu_cache.dma_flush_range | 143 | #define dmac_flush_range cpu_cache.dma_flush_range |
146 | 144 | ||
147 | #else | 145 | #else |
@@ -161,8 +159,6 @@ extern void __cpuc_flush_dcache_area(void *, size_t); | |||
161 | * is visible to DMA, or data written by DMA to system memory is | 159 | * is visible to DMA, or data written by DMA to system memory is |
162 | * visible to the CPU. | 160 | * visible to the CPU. |
163 | */ | 161 | */ |
164 | extern void dmac_map_area(const void *, size_t, int); | ||
165 | extern void dmac_unmap_area(const void *, size_t, int); | ||
166 | extern void dmac_flush_range(const void *, const void *); | 162 | extern void dmac_flush_range(const void *, const void *); |
167 | 163 | ||
168 | #endif | 164 | #endif |
diff --git a/arch/arm/include/asm/glue-cache.h b/arch/arm/include/asm/glue-cache.h index a3c24cd5b7c8..cab07f69382d 100644 --- a/arch/arm/include/asm/glue-cache.h +++ b/arch/arm/include/asm/glue-cache.h | |||
@@ -158,8 +158,6 @@ static inline void nop_dma_unmap_area(const void *s, size_t l, int f) { } | |||
158 | #define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range) | 158 | #define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range) |
159 | #define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area) | 159 | #define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area) |
160 | 160 | ||
161 | #define dmac_map_area __glue(_CACHE,_dma_map_area) | ||
162 | #define dmac_unmap_area __glue(_CACHE,_dma_unmap_area) | ||
163 | #define dmac_flush_range __glue(_CACHE,_dma_flush_range) | 161 | #define dmac_flush_range __glue(_CACHE,_dma_flush_range) |
164 | #endif | 162 | #endif |
165 | 163 | ||
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 1ced8a0f7a52..5edf17cf043d 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <asm/system_info.h> | 39 | #include <asm/system_info.h> |
40 | #include <asm/dma-contiguous.h> | 40 | #include <asm/dma-contiguous.h> |
41 | 41 | ||
42 | #include "dma.h" | ||
42 | #include "mm.h" | 43 | #include "mm.h" |
43 | 44 | ||
44 | /* | 45 | /* |
diff --git a/arch/arm/mm/dma.h b/arch/arm/mm/dma.h new file mode 100644 index 000000000000..70ea6852f94e --- /dev/null +++ b/arch/arm/mm/dma.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #ifndef DMA_H | ||
2 | #define DMA_H | ||
3 | |||
4 | #include <asm/glue-cache.h> | ||
5 | |||
6 | #ifndef MULTI_CACHE | ||
7 | #define dmac_map_area __glue(_CACHE,_dma_map_area) | ||
8 | #define dmac_unmap_area __glue(_CACHE,_dma_unmap_area) | ||
9 | |||
10 | /* | ||
11 | * These are private to the dma-mapping API. Do not use directly. | ||
12 | * Their sole purpose is to ensure that data held in the cache | ||
13 | * is visible to DMA, or data written by DMA to system memory is | ||
14 | * visible to the CPU. | ||
15 | */ | ||
16 | extern void dmac_map_area(const void *, size_t, int); | ||
17 | extern void dmac_unmap_area(const void *, size_t, int); | ||
18 | |||
19 | #else | ||
20 | |||
21 | /* | ||
22 | * These are private to the dma-mapping API. Do not use directly. | ||
23 | * Their sole purpose is to ensure that data held in the cache | ||
24 | * is visible to DMA, or data written by DMA to system memory is | ||
25 | * visible to the CPU. | ||
26 | */ | ||
27 | #define dmac_map_area cpu_cache.dma_map_area | ||
28 | #define dmac_unmap_area cpu_cache.dma_unmap_area | ||
29 | |||
30 | #endif | ||
31 | |||
32 | #endif | ||