summaryrefslogtreecommitdiff
path: root/arch/arm/common
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-09-25 21:38:41 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-09-29 10:40:16 +0100
commit2638b4dbe768aba023a06acd8e7eba708bb76ee6 (patch)
tree41e464b337ec85444d8c551947de13bb8731af70 /arch/arm/common
parent01135d92c1a540cd3370f7cf3d1c762320b85034 (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')
-rw-r--r--arch/arm/common/dmabounce.c48
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,
}
EXPORT_SYMBOL(dma_sync_single_range_for_device);
-void
-dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents,
- enum dma_data_direction dir)
+int dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr,
+ unsigned long off, size_t sz, enum dma_data_direction dir)
{
- struct scatterlist *s;
- int i;
-
- dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n",
- __func__, sg, nents, dir);
-
- BUG_ON(dir == DMA_NONE);
-
- for_each_sg(sg, s, nents, i) {
- dma_addr_t dma_addr = s->dma_address;
- unsigned int length = s->length;
-
- sync_single(dev, dma_addr, length, dir);
- }
+ dev_dbg(dev, "%s(dma=%#lx,off=%#lx,sz=%zx,dir=%x)\n",
+ __func__, addr, off, sz, dir);
+ return sync_single(dev, addr, off + sz, dir);
}
+EXPORT_SYMBOL(dmabounce_sync_for_cpu);
-void
-dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents,
- enum dma_data_direction dir)
+int dmabounce_sync_for_device(struct device *dev, dma_addr_t addr,
+ unsigned long off, size_t sz, enum dma_data_direction dir)
{
- struct scatterlist *s;
- int i;
-
- dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n",
- __func__, sg, nents, dir);
-
- BUG_ON(dir == DMA_NONE);
-
- for_each_sg(sg, s, nents, i) {
- dma_addr_t dma_addr = s->dma_address;
- unsigned int length = s->length;
-
- sync_single(dev, dma_addr, length, dir);
- }
+ dev_dbg(dev, "%s(dma=%#lx,off=%#lx,sz=%zx,dir=%x)\n",
+ __func__, addr, off, sz, dir);
+ return sync_single(dev, addr, off + sz, dir);
}
+EXPORT_SYMBOL(dmabounce_sync_for_device);
static int
dmabounce_init_pool(struct dmabounce_pool *pool, struct device *dev, const char *name,
@@ -618,8 +596,6 @@ dmabounce_unregister_dev(struct device *dev)
EXPORT_SYMBOL(dma_map_single);
EXPORT_SYMBOL(dma_unmap_single);
-EXPORT_SYMBOL(dma_sync_sg_for_cpu);
-EXPORT_SYMBOL(dma_sync_sg_for_device);
EXPORT_SYMBOL(dmabounce_register_dev);
EXPORT_SYMBOL(dmabounce_unregister_dev);