diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2008-09-25 16:38:41 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-09-29 05:40:16 -0400 |
commit | 2638b4dbe768aba023a06acd8e7eba708bb76ee6 (patch) | |
tree | 41e464b337ec85444d8c551947de13bb8731af70 /arch/arm/common/dmabounce.c | |
parent | 01135d92c1a540cd3370f7cf3d1c762320b85034 (diff) |
[ARM] dma: Reduce to one dma_sync_sg_* implementation
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common/dmabounce.c')
-rw-r--r-- | arch/arm/common/dmabounce.c | 48 |
1 files changed, 12 insertions, 36 deletions
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index 20d967376fa9..0a98148279b1 100644 --- a/arch/arm/common/dmabounce.c +++ b/arch/arm/common/dmabounce.c | |||
@@ -468,45 +468,23 @@ void dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_addr, | |||
468 | } | 468 | } |
469 | EXPORT_SYMBOL(dma_sync_single_range_for_device); | 469 | EXPORT_SYMBOL(dma_sync_single_range_for_device); |
470 | 470 | ||
471 | void | 471 | int dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr, |
472 | dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents, | 472 | unsigned long off, size_t sz, enum dma_data_direction dir) |
473 | enum dma_data_direction dir) | ||
474 | { | 473 | { |
475 | struct scatterlist *s; | 474 | dev_dbg(dev, "%s(dma=%#lx,off=%#lx,sz=%zx,dir=%x)\n", |
476 | int i; | 475 | __func__, addr, off, sz, dir); |
477 | 476 | return sync_single(dev, addr, off + sz, dir); | |
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 | sync_single(dev, dma_addr, length, dir); | ||
488 | } | ||
489 | } | 477 | } |
478 | EXPORT_SYMBOL(dmabounce_sync_for_cpu); | ||
490 | 479 | ||
491 | void | 480 | int dmabounce_sync_for_device(struct device *dev, dma_addr_t addr, |
492 | dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents, | 481 | unsigned long off, size_t sz, enum dma_data_direction dir) |
493 | enum dma_data_direction dir) | ||
494 | { | 482 | { |
495 | struct scatterlist *s; | 483 | dev_dbg(dev, "%s(dma=%#lx,off=%#lx,sz=%zx,dir=%x)\n", |
496 | int i; | 484 | __func__, addr, off, sz, dir); |
497 | 485 | return sync_single(dev, addr, off + sz, dir); | |
498 | dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n", | ||
499 | __func__, sg, nents, dir); | ||
500 | |||
501 | BUG_ON(dir == DMA_NONE); | ||
502 | |||
503 | for_each_sg(sg, s, nents, i) { | ||
504 | dma_addr_t dma_addr = s->dma_address; | ||
505 | unsigned int length = s->length; | ||
506 | |||
507 | sync_single(dev, dma_addr, length, dir); | ||
508 | } | ||
509 | } | 486 | } |
487 | EXPORT_SYMBOL(dmabounce_sync_for_device); | ||
510 | 488 | ||
511 | static int | 489 | static int |
512 | dmabounce_init_pool(struct dmabounce_pool *pool, struct device *dev, const char *name, | 490 | dmabounce_init_pool(struct dmabounce_pool *pool, struct device *dev, const char *name, |
@@ -618,8 +596,6 @@ dmabounce_unregister_dev(struct device *dev) | |||
618 | 596 | ||
619 | EXPORT_SYMBOL(dma_map_single); | 597 | EXPORT_SYMBOL(dma_map_single); |
620 | EXPORT_SYMBOL(dma_unmap_single); | 598 | EXPORT_SYMBOL(dma_unmap_single); |
621 | EXPORT_SYMBOL(dma_sync_sg_for_cpu); | ||
622 | EXPORT_SYMBOL(dma_sync_sg_for_device); | ||
623 | EXPORT_SYMBOL(dmabounce_register_dev); | 599 | EXPORT_SYMBOL(dmabounce_register_dev); |
624 | EXPORT_SYMBOL(dmabounce_unregister_dev); | 600 | EXPORT_SYMBOL(dmabounce_unregister_dev); |
625 | 601 | ||