aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-09-25 16:05:02 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-09-25 18:39:24 -0400
commit01135d92c1a540cd3370f7cf3d1c762320b85034 (patch)
treea6344d942a4f63cba85290a93008ce211996d27d /arch/arm/common
parent56f55f8b58a02e95b401cb50df05086cabeaeeb5 (diff)
[ARM] dma: Reduce to one dma_map_sg()/dma_unmap_sg() implementation
No point having two of these; dma_map_page() can do all the work for us. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common')
-rw-r--r--arch/arm/common/dmabounce.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index c7f23ced0a36..20d967376fa9 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -444,50 +444,6 @@ dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
444 unmap_single(dev, dma_addr, size, dir); 444 unmap_single(dev, dma_addr, size, dir);
445} 445}
446 446
447int
448dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
449 enum dma_data_direction dir)
450{
451 struct scatterlist *s;
452 int i;
453
454 dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n",
455 __func__, sg, nents, dir);
456
457 BUG_ON(dir == DMA_NONE);
458
459 for_each_sg(sg, s, nents, i) {
460 struct page *page = sg_page(s);
461 unsigned int offset = s->offset;
462 unsigned int length = s->length;
463 void *ptr = page_address(page) + offset;
464
465 s->dma_address = map_single(dev, ptr, length, dir);
466 }
467
468 return nents;
469}
470
471void
472dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
473 enum dma_data_direction dir)
474{
475 struct scatterlist *s;
476 int i;
477
478 dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n",
479 __func__, sg, nents, dir);
480
481 BUG_ON(dir == DMA_NONE);
482
483 for_each_sg(sg, s, nents, i) {
484 dma_addr_t dma_addr = s->dma_address;
485 unsigned int length = s->length;
486
487 unmap_single(dev, dma_addr, length, dir);
488 }
489}
490
491void dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_addr, 447void dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_addr,
492 unsigned long offset, size_t size, 448 unsigned long offset, size_t size,
493 enum dma_data_direction dir) 449 enum dma_data_direction dir)
@@ -662,8 +618,6 @@ dmabounce_unregister_dev(struct device *dev)
662 618
663EXPORT_SYMBOL(dma_map_single); 619EXPORT_SYMBOL(dma_map_single);
664EXPORT_SYMBOL(dma_unmap_single); 620EXPORT_SYMBOL(dma_unmap_single);
665EXPORT_SYMBOL(dma_map_sg);
666EXPORT_SYMBOL(dma_unmap_sg);
667EXPORT_SYMBOL(dma_sync_sg_for_cpu); 621EXPORT_SYMBOL(dma_sync_sg_for_cpu);
668EXPORT_SYMBOL(dma_sync_sg_for_device); 622EXPORT_SYMBOL(dma_sync_sg_for_device);
669EXPORT_SYMBOL(dmabounce_register_dev); 623EXPORT_SYMBOL(dmabounce_register_dev);