diff options
author | Christoph Hellwig <hch@lst.de> | 2015-09-09 18:39:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-10 16:29:01 -0400 |
commit | efa21e432c7b3c8ae976039d614a017799b6e874 (patch) | |
tree | feab602cd4ff56407fd64a468ee6939b88d2141b /arch | |
parent | 1e8937526e2309d48fccd81bb30a590ac21a5516 (diff) |
dma-mapping: cosolidate dma_mapping_error
Currently there are three valid implementations of dma_mapping_error:
(1) call ->mapping_error
(2) check for a hardcoded error code
(3) always return 0
This patch provides a common implementation that calls ->mapping_error
if present, then checks for DMA_ERROR_CODE if defined or otherwise
returns 0.
[jcmvbkbc@gmail.com: fix xtensa]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
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.h | 5 | ||||
-rw-r--r-- | arch/arm/include/asm/dma-mapping.h | 9 | ||||
-rw-r--r-- | arch/arm64/include/asm/dma-mapping.h | 7 | ||||
-rw-r--r-- | arch/h8300/include/asm/dma-mapping.h | 5 | ||||
-rw-r--r-- | arch/hexagon/include/asm/dma-mapping.h | 11 | ||||
-rw-r--r-- | arch/ia64/include/asm/dma-mapping.h | 7 | ||||
-rw-r--r-- | arch/microblaze/include/asm/dma-mapping.h | 11 | ||||
-rw-r--r-- | arch/mips/include/asm/dma-mapping.h | 8 | ||||
-rw-r--r-- | arch/openrisc/include/asm/dma-mapping.h | 5 | ||||
-rw-r--r-- | arch/powerpc/include/asm/dma-mapping.h | 17 | ||||
-rw-r--r-- | arch/s390/include/asm/dma-mapping.h | 10 | ||||
-rw-r--r-- | arch/sh/include/asm/dma-mapping.h | 13 | ||||
-rw-r--r-- | arch/sparc/include/asm/dma-mapping.h | 6 | ||||
-rw-r--r-- | arch/tile/include/asm/dma-mapping.h | 7 | ||||
-rw-r--r-- | arch/unicore32/include/asm/dma-mapping.h | 10 | ||||
-rw-r--r-- | arch/x86/include/asm/dma-mapping.h | 11 | ||||
-rw-r--r-- | arch/xtensa/include/asm/dma-mapping.h | 9 |
17 files changed, 5 insertions, 146 deletions
diff --git a/arch/alpha/include/asm/dma-mapping.h b/arch/alpha/include/asm/dma-mapping.h index 0552bf097245..80ac3e835efe 100644 --- a/arch/alpha/include/asm/dma-mapping.h +++ b/arch/alpha/include/asm/dma-mapping.h | |||
@@ -12,11 +12,6 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) | |||
12 | 12 | ||
13 | #include <asm-generic/dma-mapping-common.h> | 13 | #include <asm-generic/dma-mapping-common.h> |
14 | 14 | ||
15 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
16 | { | ||
17 | return get_dma_ops(dev)->mapping_error(dev, dma_addr); | ||
18 | } | ||
19 | |||
20 | static inline int dma_supported(struct device *dev, u64 mask) | 15 | static inline int dma_supported(struct device *dev, u64 mask) |
21 | { | 16 | { |
22 | return get_dma_ops(dev)->dma_supported(dev, mask); | 17 | return get_dma_ops(dev)->dma_supported(dev, mask); |
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index 0b7787167b64..9bef3c541c39 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h | |||
@@ -172,15 +172,6 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) | |||
172 | 172 | ||
173 | static inline void dma_mark_clean(void *addr, size_t size) { } | 173 | static inline void dma_mark_clean(void *addr, size_t size) { } |
174 | 174 | ||
175 | /* | ||
176 | * DMA errors are defined by all-bits-set in the DMA address. | ||
177 | */ | ||
178 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
179 | { | ||
180 | debug_dma_mapping_error(dev, dma_addr); | ||
181 | return dma_addr == DMA_ERROR_CODE; | ||
182 | } | ||
183 | |||
184 | extern int dma_supported(struct device *dev, u64 mask); | 175 | extern int dma_supported(struct device *dev, u64 mask); |
185 | 176 | ||
186 | extern int arm_dma_set_mask(struct device *dev, u64 dma_mask); | 177 | extern int arm_dma_set_mask(struct device *dev, u64 dma_mask); |
diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h index 178e60b80922..f45f444b7a66 100644 --- a/arch/arm64/include/asm/dma-mapping.h +++ b/arch/arm64/include/asm/dma-mapping.h | |||
@@ -84,13 +84,6 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t dev_addr) | |||
84 | return (phys_addr_t)dev_addr; | 84 | return (phys_addr_t)dev_addr; |
85 | } | 85 | } |
86 | 86 | ||
87 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dev_addr) | ||
88 | { | ||
89 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
90 | debug_dma_mapping_error(dev, dev_addr); | ||
91 | return ops->mapping_error(dev, dev_addr); | ||
92 | } | ||
93 | |||
94 | static inline int dma_supported(struct device *dev, u64 mask) | 87 | static inline int dma_supported(struct device *dev, u64 mask) |
95 | { | 88 | { |
96 | struct dma_map_ops *ops = get_dma_ops(dev); | 89 | struct dma_map_ops *ops = get_dma_ops(dev); |
diff --git a/arch/h8300/include/asm/dma-mapping.h b/arch/h8300/include/asm/dma-mapping.h index 72465ce59453..5eef05382fff 100644 --- a/arch/h8300/include/asm/dma-mapping.h +++ b/arch/h8300/include/asm/dma-mapping.h | |||
@@ -20,9 +20,4 @@ static inline int dma_set_mask(struct device *dev, u64 mask) | |||
20 | return 0; | 20 | return 0; |
21 | } | 21 | } |
22 | 22 | ||
23 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
24 | { | ||
25 | return 0; | ||
26 | } | ||
27 | |||
28 | #endif | 23 | #endif |
diff --git a/arch/hexagon/include/asm/dma-mapping.h b/arch/hexagon/include/asm/dma-mapping.h index 58d2d8f1544a..e66119290eca 100644 --- a/arch/hexagon/include/asm/dma-mapping.h +++ b/arch/hexagon/include/asm/dma-mapping.h | |||
@@ -31,6 +31,7 @@ | |||
31 | 31 | ||
32 | struct device; | 32 | struct device; |
33 | extern int bad_dma_address; | 33 | extern int bad_dma_address; |
34 | #define DMA_ERROR_CODE bad_dma_address | ||
34 | 35 | ||
35 | extern struct dma_map_ops *dma_ops; | 36 | extern struct dma_map_ops *dma_ops; |
36 | 37 | ||
@@ -57,14 +58,4 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) | |||
57 | return addr + size - 1 <= *dev->dma_mask; | 58 | return addr + size - 1 <= *dev->dma_mask; |
58 | } | 59 | } |
59 | 60 | ||
60 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
61 | { | ||
62 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | ||
63 | |||
64 | if (dma_ops->mapping_error) | ||
65 | return dma_ops->mapping_error(dev, dma_addr); | ||
66 | |||
67 | return (dma_addr == bad_dma_address); | ||
68 | } | ||
69 | |||
70 | #endif | 61 | #endif |
diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h index a925ff03c964..27b713d0edbc 100644 --- a/arch/ia64/include/asm/dma-mapping.h +++ b/arch/ia64/include/asm/dma-mapping.h | |||
@@ -27,13 +27,6 @@ extern void machvec_dma_sync_sg(struct device *, struct scatterlist *, int, | |||
27 | 27 | ||
28 | #include <asm-generic/dma-mapping-common.h> | 28 | #include <asm-generic/dma-mapping-common.h> |
29 | 29 | ||
30 | static inline int dma_mapping_error(struct device *dev, dma_addr_t daddr) | ||
31 | { | ||
32 | struct dma_map_ops *ops = platform_dma_get_ops(dev); | ||
33 | debug_dma_mapping_error(dev, daddr); | ||
34 | return ops->mapping_error(dev, daddr); | ||
35 | } | ||
36 | |||
37 | static inline int dma_supported(struct device *dev, u64 mask) | 30 | static inline int dma_supported(struct device *dev, u64 mask) |
38 | { | 31 | { |
39 | struct dma_map_ops *ops = platform_dma_get_ops(dev); | 32 | struct dma_map_ops *ops = platform_dma_get_ops(dev); |
diff --git a/arch/microblaze/include/asm/dma-mapping.h b/arch/microblaze/include/asm/dma-mapping.h index bc81625d486f..e5b843839263 100644 --- a/arch/microblaze/include/asm/dma-mapping.h +++ b/arch/microblaze/include/asm/dma-mapping.h | |||
@@ -87,17 +87,6 @@ static inline void __dma_sync(unsigned long paddr, | |||
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
91 | { | ||
92 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
93 | |||
94 | debug_dma_mapping_error(dev, dma_addr); | ||
95 | if (ops->mapping_error) | ||
96 | return ops->mapping_error(dev, dma_addr); | ||
97 | |||
98 | return (dma_addr == DMA_ERROR_CODE); | ||
99 | } | ||
100 | |||
101 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 90 | static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
102 | enum dma_data_direction direction) | 91 | enum dma_data_direction direction) |
103 | { | 92 | { |
diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h index 709b2ba79cc3..158bb36bdcb4 100644 --- a/arch/mips/include/asm/dma-mapping.h +++ b/arch/mips/include/asm/dma-mapping.h | |||
@@ -37,14 +37,6 @@ static inline int dma_supported(struct device *dev, u64 mask) | |||
37 | return ops->dma_supported(dev, mask); | 37 | return ops->dma_supported(dev, mask); |
38 | } | 38 | } |
39 | 39 | ||
40 | static inline int dma_mapping_error(struct device *dev, u64 mask) | ||
41 | { | ||
42 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
43 | |||
44 | debug_dma_mapping_error(dev, mask); | ||
45 | return ops->mapping_error(dev, mask); | ||
46 | } | ||
47 | |||
48 | static inline int | 40 | static inline int |
49 | dma_set_mask(struct device *dev, u64 mask) | 41 | dma_set_mask(struct device *dev, u64 mask) |
50 | { | 42 | { |
diff --git a/arch/openrisc/include/asm/dma-mapping.h b/arch/openrisc/include/asm/dma-mapping.h index 57722528ea4d..7dfe9d50856e 100644 --- a/arch/openrisc/include/asm/dma-mapping.h +++ b/arch/openrisc/include/asm/dma-mapping.h | |||
@@ -43,11 +43,6 @@ static inline int dma_supported(struct device *dev, u64 dma_mask) | |||
43 | return dma_mask == DMA_BIT_MASK(32); | 43 | return dma_mask == DMA_BIT_MASK(32); |
44 | } | 44 | } |
45 | 45 | ||
46 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
47 | { | ||
48 | return 0; | ||
49 | } | ||
50 | |||
51 | static inline int dma_set_mask(struct device *dev, u64 dma_mask) | 46 | static inline int dma_set_mask(struct device *dev, u64 dma_mask) |
52 | { | 47 | { |
53 | if (!dev->dma_mask || !dma_supported(dev, dma_mask)) | 48 | if (!dev->dma_mask || !dma_supported(dev, dma_mask)) |
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h index 7971b421c677..712d5afc055a 100644 --- a/arch/powerpc/include/asm/dma-mapping.h +++ b/arch/powerpc/include/asm/dma-mapping.h | |||
@@ -18,7 +18,9 @@ | |||
18 | #include <asm/io.h> | 18 | #include <asm/io.h> |
19 | #include <asm/swiotlb.h> | 19 | #include <asm/swiotlb.h> |
20 | 20 | ||
21 | #ifdef CONFIG_PPC64 | ||
21 | #define DMA_ERROR_CODE (~(dma_addr_t)0x0) | 22 | #define DMA_ERROR_CODE (~(dma_addr_t)0x0) |
23 | #endif | ||
22 | 24 | ||
23 | /* Some dma direct funcs must be visible for use in other dma_ops */ | 25 | /* Some dma direct funcs must be visible for use in other dma_ops */ |
24 | extern void *__dma_direct_alloc_coherent(struct device *dev, size_t size, | 26 | extern void *__dma_direct_alloc_coherent(struct device *dev, size_t size, |
@@ -137,21 +139,6 @@ extern int dma_set_mask(struct device *dev, u64 dma_mask); | |||
137 | extern int __dma_set_mask(struct device *dev, u64 dma_mask); | 139 | extern int __dma_set_mask(struct device *dev, u64 dma_mask); |
138 | extern u64 __dma_get_required_mask(struct device *dev); | 140 | extern u64 __dma_get_required_mask(struct device *dev); |
139 | 141 | ||
140 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
141 | { | ||
142 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | ||
143 | |||
144 | debug_dma_mapping_error(dev, dma_addr); | ||
145 | if (dma_ops->mapping_error) | ||
146 | return dma_ops->mapping_error(dev, dma_addr); | ||
147 | |||
148 | #ifdef CONFIG_PPC64 | ||
149 | return (dma_addr == DMA_ERROR_CODE); | ||
150 | #else | ||
151 | return 0; | ||
152 | #endif | ||
153 | } | ||
154 | |||
155 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) | 142 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) |
156 | { | 143 | { |
157 | #ifdef CONFIG_SWIOTLB | 144 | #ifdef CONFIG_SWIOTLB |
diff --git a/arch/s390/include/asm/dma-mapping.h b/arch/s390/include/asm/dma-mapping.h index b729efeb9ad8..3c293291319b 100644 --- a/arch/s390/include/asm/dma-mapping.h +++ b/arch/s390/include/asm/dma-mapping.h | |||
@@ -43,14 +43,4 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) | |||
43 | return addr + size - 1 <= *dev->dma_mask; | 43 | return addr + size - 1 <= *dev->dma_mask; |
44 | } | 44 | } |
45 | 45 | ||
46 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
47 | { | ||
48 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | ||
49 | |||
50 | debug_dma_mapping_error(dev, dma_addr); | ||
51 | if (dma_ops->mapping_error) | ||
52 | return dma_ops->mapping_error(dev, dma_addr); | ||
53 | return dma_addr == DMA_ERROR_CODE; | ||
54 | } | ||
55 | |||
56 | #endif /* _ASM_S390_DMA_MAPPING_H */ | 46 | #endif /* _ASM_S390_DMA_MAPPING_H */ |
diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h index 2c3fa2ccbe9b..98308c497162 100644 --- a/arch/sh/include/asm/dma-mapping.h +++ b/arch/sh/include/asm/dma-mapping.h | |||
@@ -9,6 +9,8 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) | |||
9 | return dma_ops; | 9 | return dma_ops; |
10 | } | 10 | } |
11 | 11 | ||
12 | #define DMA_ERROR_CODE 0 | ||
13 | |||
12 | #include <asm-generic/dma-mapping-common.h> | 14 | #include <asm-generic/dma-mapping-common.h> |
13 | 15 | ||
14 | static inline int dma_supported(struct device *dev, u64 mask) | 16 | static inline int dma_supported(struct device *dev, u64 mask) |
@@ -38,17 +40,6 @@ static inline int dma_set_mask(struct device *dev, u64 mask) | |||
38 | void dma_cache_sync(struct device *dev, void *vaddr, size_t size, | 40 | void dma_cache_sync(struct device *dev, void *vaddr, size_t size, |
39 | enum dma_data_direction dir); | 41 | enum dma_data_direction dir); |
40 | 42 | ||
41 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
42 | { | ||
43 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
44 | |||
45 | debug_dma_mapping_error(dev, dma_addr); | ||
46 | if (ops->mapping_error) | ||
47 | return ops->mapping_error(dev, dma_addr); | ||
48 | |||
49 | return dma_addr == 0; | ||
50 | } | ||
51 | |||
52 | /* arch/sh/mm/consistent.c */ | 43 | /* arch/sh/mm/consistent.c */ |
53 | extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, | 44 | extern void *dma_generic_alloc_coherent(struct device *dev, size_t size, |
54 | dma_addr_t *dma_addr, gfp_t flag, | 45 | dma_addr_t *dma_addr, gfp_t flag, |
diff --git a/arch/sparc/include/asm/dma-mapping.h b/arch/sparc/include/asm/dma-mapping.h index 2564edcb9728..5069d137453b 100644 --- a/arch/sparc/include/asm/dma-mapping.h +++ b/arch/sparc/include/asm/dma-mapping.h | |||
@@ -38,12 +38,6 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) | |||
38 | 38 | ||
39 | #include <asm-generic/dma-mapping-common.h> | 39 | #include <asm-generic/dma-mapping-common.h> |
40 | 40 | ||
41 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
42 | { | ||
43 | debug_dma_mapping_error(dev, dma_addr); | ||
44 | return (dma_addr == DMA_ERROR_CODE); | ||
45 | } | ||
46 | |||
47 | static inline int dma_set_mask(struct device *dev, u64 mask) | 41 | static inline int dma_set_mask(struct device *dev, u64 mask) |
48 | { | 42 | { |
49 | #ifdef CONFIG_PCI | 43 | #ifdef CONFIG_PCI |
diff --git a/arch/tile/include/asm/dma-mapping.h b/arch/tile/include/asm/dma-mapping.h index e982dfa5d2f4..f8f7a05023bf 100644 --- a/arch/tile/include/asm/dma-mapping.h +++ b/arch/tile/include/asm/dma-mapping.h | |||
@@ -75,13 +75,6 @@ static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) | |||
75 | } | 75 | } |
76 | 76 | ||
77 | static inline int | 77 | static inline int |
78 | dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
79 | { | ||
80 | debug_dma_mapping_error(dev, dma_addr); | ||
81 | return get_dma_ops(dev)->mapping_error(dev, dma_addr); | ||
82 | } | ||
83 | |||
84 | static inline int | ||
85 | dma_supported(struct device *dev, u64 mask) | 78 | dma_supported(struct device *dev, u64 mask) |
86 | { | 79 | { |
87 | return get_dma_ops(dev)->dma_supported(dev, mask); | 80 | return get_dma_ops(dev)->dma_supported(dev, mask); |
diff --git a/arch/unicore32/include/asm/dma-mapping.h b/arch/unicore32/include/asm/dma-mapping.h index 636e942940a0..175d7e3f7b0a 100644 --- a/arch/unicore32/include/asm/dma-mapping.h +++ b/arch/unicore32/include/asm/dma-mapping.h | |||
@@ -38,16 +38,6 @@ static inline int dma_supported(struct device *dev, u64 mask) | |||
38 | return dma_ops->dma_supported(dev, mask); | 38 | return dma_ops->dma_supported(dev, mask); |
39 | } | 39 | } |
40 | 40 | ||
41 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
42 | { | ||
43 | struct dma_map_ops *dma_ops = get_dma_ops(dev); | ||
44 | |||
45 | if (dma_ops->mapping_error) | ||
46 | return dma_ops->mapping_error(dev, dma_addr); | ||
47 | |||
48 | return 0; | ||
49 | } | ||
50 | |||
51 | #include <asm-generic/dma-mapping-common.h> | 41 | #include <asm-generic/dma-mapping-common.h> |
52 | 42 | ||
53 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) | 43 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) |
diff --git a/arch/x86/include/asm/dma-mapping.h b/arch/x86/include/asm/dma-mapping.h index 7e47e4d6e69c..bbca62e3e43f 100644 --- a/arch/x86/include/asm/dma-mapping.h +++ b/arch/x86/include/asm/dma-mapping.h | |||
@@ -45,17 +45,6 @@ bool arch_dma_alloc_attrs(struct device **dev, gfp_t *gfp); | |||
45 | 45 | ||
46 | #include <asm-generic/dma-mapping-common.h> | 46 | #include <asm-generic/dma-mapping-common.h> |
47 | 47 | ||
48 | /* Make sure we keep the same behaviour */ | ||
49 | static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
50 | { | ||
51 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
52 | debug_dma_mapping_error(dev, dma_addr); | ||
53 | if (ops->mapping_error) | ||
54 | return ops->mapping_error(dev, dma_addr); | ||
55 | |||
56 | return (dma_addr == DMA_ERROR_CODE); | ||
57 | } | ||
58 | |||
59 | extern int dma_supported(struct device *hwdev, u64 mask); | 48 | extern int dma_supported(struct device *hwdev, u64 mask); |
60 | extern int dma_set_mask(struct device *dev, u64 mask); | 49 | extern int dma_set_mask(struct device *dev, u64 mask); |
61 | 50 | ||
diff --git a/arch/xtensa/include/asm/dma-mapping.h b/arch/xtensa/include/asm/dma-mapping.h index 0a19581375da..21925bfdaff7 100644 --- a/arch/xtensa/include/asm/dma-mapping.h +++ b/arch/xtensa/include/asm/dma-mapping.h | |||
@@ -33,15 +33,6 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) | |||
33 | #include <asm-generic/dma-mapping-common.h> | 33 | #include <asm-generic/dma-mapping-common.h> |
34 | 34 | ||
35 | static inline int | 35 | static inline int |
36 | dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
37 | { | ||
38 | struct dma_map_ops *ops = get_dma_ops(dev); | ||
39 | |||
40 | debug_dma_mapping_error(dev, dma_addr); | ||
41 | return ops->mapping_error(dev, dma_addr); | ||
42 | } | ||
43 | |||
44 | static inline int | ||
45 | dma_supported(struct device *dev, u64 mask) | 36 | dma_supported(struct device *dev, u64 mask) |
46 | { | 37 | { |
47 | return 1; | 38 | return 1; |