summaryrefslogtreecommitdiffstats
path: root/arch/arm/common
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-09-25 21:59:12 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-09-26 00:39:24 +0200
commit56f55f8b58a02e95b401cb50df05086cabeaeeb5 (patch)
tree3be7e3383157c731178ca447008c0e7c236bfbfc /arch/arm/common
parent[ARM] Update dma_map_sg()/dma_unmap_sg() API (diff)
downloadlinux-56f55f8b58a02e95b401cb50df05086cabeaeeb5.tar.xz
linux-56f55f8b58a02e95b401cb50df05086cabeaeeb5.zip
[ARM] dma: provide a better dma_map_page() implementation
We can translate a struct page directly to a DMA address using page_to_dma(). No need to use page_address() followed by virt_to_dma(). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common')
-rw-r--r--arch/arm/common/dmabounce.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c
index 35c72bcf3d0b..c7f23ced0a36 100644
--- a/arch/arm/common/dmabounce.c
+++ b/arch/arm/common/dmabounce.c
@@ -412,6 +412,19 @@ dma_map_single(struct device *dev, void *ptr, size_t size,
return dma_addr;
}
+dma_addr_t dma_map_page(struct device *dev, struct page *page,
+ unsigned long offset, size_t size,
+ enum dma_data_direction dir)
+{
+ dev_dbg(dev, "%s(page=%p,off=%#lx,size=%zx,dir=%x)\n",
+ __func__, page, offset, size, dir);
+
+ BUG_ON(dir == DMA_NONE);
+
+ return map_single(dev, page_address(page) + offset, size, dir);
+}
+EXPORT_SYMBOL(dma_map_page);
+
/*
* see if a mapped address was really a "safe" buffer and if so, copy
* the data from the safe buffer back to the unsafe buffer and free up