aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/dma-mapping.h
diff options
context:
space:
mode:
authorMark Nelson <markn@au1.ibm.com>2008-10-27 16:38:14 -0400
committerPaul Mackerras <paulus@samba.org>2008-11-05 17:43:46 -0500
commitc73049f6aa58ac1d1a9ca8cb2b415ef97240b2d3 (patch)
tree7beed69dd3a8773c96317297fba501399091efa2 /arch/powerpc/include/asm/dma-mapping.h
parent7eef440a545c7f812ed10b49d4a10a351df9cad6 (diff)
powerpc: Remove map_/unmap_single() from dma_mapping_ops
Now that all of the remaining dma_mapping_ops have had their map_/unmap_single functions updated to become map/unmap_page functions, there is no need to have the map_/unmap_single function pointers in the dma_mapping_ops. So, this removes them and also removes the code that does the checking for which set of functions to use. Signed-off-by: Mark Nelson <markn@au1.ibm.com> Acked-by: Becky Bruce <becky.bruce@freescale.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/include/asm/dma-mapping.h')
-rw-r--r--arch/powerpc/include/asm/dma-mapping.h36
1 files changed, 5 insertions, 31 deletions
diff --git a/arch/powerpc/include/asm/dma-mapping.h b/arch/powerpc/include/asm/dma-mapping.h
index fddb229bd74..3c4a2c21d60 100644
--- a/arch/powerpc/include/asm/dma-mapping.h
+++ b/arch/powerpc/include/asm/dma-mapping.h
@@ -60,12 +60,6 @@ struct dma_mapping_ops {
60 dma_addr_t *dma_handle, gfp_t flag); 60 dma_addr_t *dma_handle, gfp_t flag);
61 void (*free_coherent)(struct device *dev, size_t size, 61 void (*free_coherent)(struct device *dev, size_t size,
62 void *vaddr, dma_addr_t dma_handle); 62 void *vaddr, dma_addr_t dma_handle);
63 dma_addr_t (*map_single)(struct device *dev, void *ptr,
64 size_t size, enum dma_data_direction direction,
65 struct dma_attrs *attrs);
66 void (*unmap_single)(struct device *dev, dma_addr_t dma_addr,
67 size_t size, enum dma_data_direction direction,
68 struct dma_attrs *attrs);
69 int (*map_sg)(struct device *dev, struct scatterlist *sg, 63 int (*map_sg)(struct device *dev, struct scatterlist *sg,
70 int nents, enum dma_data_direction direction, 64 int nents, enum dma_data_direction direction,
71 struct dma_attrs *attrs); 65 struct dma_attrs *attrs);
@@ -149,10 +143,9 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
149} 143}
150 144
151/* 145/*
152 * TODO: map_/unmap_single will ideally go away, to be completely 146 * map_/unmap_single actually call through to map/unmap_page now that all the
153 * replaced by map/unmap_page. Until then, we allow dma_ops to have 147 * dma_mapping_ops have been converted over. We just have to get the page and
154 * one or the other, or both by checking to see if the specific 148 * offset to pass through to map_page
155 * function requested exists; and if not, falling back on the other set.
156 */ 149 */
157static inline dma_addr_t dma_map_single_attrs(struct device *dev, 150static inline dma_addr_t dma_map_single_attrs(struct device *dev,
158 void *cpu_addr, 151 void *cpu_addr,
@@ -164,10 +157,6 @@ static inline dma_addr_t dma_map_single_attrs(struct device *dev,
164 157
165 BUG_ON(!dma_ops); 158 BUG_ON(!dma_ops);
166 159
167 if (dma_ops->map_single)
168 return dma_ops->map_single(dev, cpu_addr, size, direction,
169 attrs);
170
171 return dma_ops->map_page(dev, virt_to_page(cpu_addr), 160 return dma_ops->map_page(dev, virt_to_page(cpu_addr),
172 (unsigned long)cpu_addr % PAGE_SIZE, size, 161 (unsigned long)cpu_addr % PAGE_SIZE, size,
173 direction, attrs); 162 direction, attrs);
@@ -183,11 +172,6 @@ static inline void dma_unmap_single_attrs(struct device *dev,
183 172
184 BUG_ON(!dma_ops); 173 BUG_ON(!dma_ops);
185 174
186 if (dma_ops->unmap_single) {
187 dma_ops->unmap_single(dev, dma_addr, size, direction, attrs);
188 return;
189 }
190
191 dma_ops->unmap_page(dev, dma_addr, size, direction, attrs); 175 dma_ops->unmap_page(dev, dma_addr, size, direction, attrs);
192} 176}
193 177
@@ -201,12 +185,7 @@ static inline dma_addr_t dma_map_page_attrs(struct device *dev,
201 185
202 BUG_ON(!dma_ops); 186 BUG_ON(!dma_ops);
203 187
204 if (dma_ops->map_page) 188 return dma_ops->map_page(dev, page, offset, size, direction, attrs);
205 return dma_ops->map_page(dev, page, offset, size, direction,
206 attrs);
207
208 return dma_ops->map_single(dev, page_address(page) + offset, size,
209 direction, attrs);
210} 189}
211 190
212static inline void dma_unmap_page_attrs(struct device *dev, 191static inline void dma_unmap_page_attrs(struct device *dev,
@@ -219,12 +198,7 @@ static inline void dma_unmap_page_attrs(struct device *dev,
219 198
220 BUG_ON(!dma_ops); 199 BUG_ON(!dma_ops);
221 200
222 if (dma_ops->unmap_page) { 201 dma_ops->unmap_page(dev, dma_address, size, direction, attrs);
223 dma_ops->unmap_page(dev, dma_address, size, direction, attrs);
224 return;
225 }
226
227 dma_ops->unmap_single(dev, dma_address, size, direction, attrs);
228} 202}
229 203
230static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg, 204static inline int dma_map_sg_attrs(struct device *dev, struct scatterlist *sg,