aboutsummaryrefslogtreecommitdiff
path: root/arch/avr32/mm/dma-coherent.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-09 12:50:25 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-09 12:50:25 -0700
commit3960208f9ca0cf6bdb31c21c59ac0526303f8b34 (patch)
treeca1948cec8fb390e5298498361194db145e2e49f /arch/avr32/mm/dma-coherent.c
parentb0b73cb41d56ee391f20cbd3e4304e2303a8829b (diff)
parent47cc3e780474be2e462278d63d77c27a493b28ed (diff)
Merge branch 'for-linus' of git://www.atmel.no/~hskinnemoen/linux/kernel/avr32
* 'for-linus' of git://www.atmel.no/~hskinnemoen/linux/kernel/avr32: [AVR32] Wire up sys_utimensat [AVR32] Fix section mismatch .taglist -> .init.text [AVR32] Implement dma_{alloc,free}_writecombine() AVR32: Spinlock initializer cleanup [AVR32] Use correct config symbol when setting cpuflags
Diffstat (limited to 'arch/avr32/mm/dma-coherent.c')
-rw-r--r--arch/avr32/mm/dma-coherent.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/avr32/mm/dma-coherent.c b/arch/avr32/mm/dma-coherent.c
index b68d669f823..099212d4567 100644
--- a/arch/avr32/mm/dma-coherent.c
+++ b/arch/avr32/mm/dma-coherent.c
@@ -112,16 +112,21 @@ void dma_free_coherent(struct device *dev, size_t size,
}
EXPORT_SYMBOL(dma_free_coherent);
-#if 0
void *dma_alloc_writecombine(struct device *dev, size_t size,
dma_addr_t *handle, gfp_t gfp)
{
struct page *page;
+ dma_addr_t phys;
page = __dma_alloc(dev, size, handle, gfp);
+ if (!page)
+ return NULL;
+
+ phys = page_to_phys(page);
+ *handle = phys;
/* Now, map the page into P3 with write-combining turned on */
- return __ioremap(page_to_phys(page), size, _PAGE_BUFFER);
+ return __ioremap(phys, size, _PAGE_BUFFER);
}
EXPORT_SYMBOL(dma_alloc_writecombine);
@@ -132,8 +137,7 @@ void dma_free_writecombine(struct device *dev, size_t size,
iounmap(cpu_addr);
- page = bus_to_page(handle);
+ page = phys_to_page(handle);
__dma_free(dev, size, page, handle);
}
EXPORT_SYMBOL(dma_free_writecombine);
-#endif