aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mm/consistent.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.lan>2008-07-28 15:15:46 -0700
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-07-28 15:15:46 -0700
commit756f7bc6683916177e8176f8d3fa5f4c11c88afc (patch)
treecbe3ffc375950b016198fa61dea63bb449c59c93 /arch/arm/mm/consistent.c
parent979b1791e5b8f8b556faeec4c48339e7ed63af9f (diff)
parentcb28a1bbdb4790378e7366d6c9ee1d2340b84f92 (diff)
Merge branch 'core/generic-dma-coherent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip into for-linus
Diffstat (limited to 'arch/arm/mm/consistent.c')
-rw-r--r--arch/arm/mm/consistent.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mm/consistent.c b/arch/arm/mm/consistent.c
index 333a82a3717..db7b3e38ef1 100644
--- a/arch/arm/mm/consistent.c
+++ b/arch/arm/mm/consistent.c
@@ -274,6 +274,11 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
void *
dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp)
{
+ void *memory;
+
+ if (dma_alloc_from_coherent(dev, size, handle, &memory))
+ return memory;
+
if (arch_is_coherent()) {
void *virt;
@@ -362,6 +367,9 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr
WARN_ON(irqs_disabled());
+ if (dma_release_from_coherent(dev, get_order(size), cpu_addr))
+ return;
+
if (arch_is_coherent()) {
kfree(cpu_addr);
return;