diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-02 19:00:17 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-03 06:27:43 -0500 |
commit | 9eedd96301cad8ab58ee8c1e579677d0a75c2ba1 (patch) | |
tree | 87f5ebbbd5769516771bef37574b39464177f496 /arch/arm/mm | |
parent | 3d29005ab8d828e36108ecc2338612ce3acdd86f (diff) |
ARM: DMA: Replace page_to_dma()/dma_to_page() with pfn_to_dma()/dma_to_pfn()
Replace the page_to_dma() and dma_to_page() macros with their PFN
equivalents. This allows us to map parts of memory which do not have
a struct page allocated to them to bus addresses. This will be used
internally by dma_alloc_coherent()/dma_alloc_writecombine().
Build tested on Versatile, OMAP1, IOP13xx and KS8695.
Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/dma-mapping.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index e4dd0646e859..44e72108d7a7 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -311,7 +311,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp, | |||
311 | addr = page_address(page); | 311 | addr = page_address(page); |
312 | 312 | ||
313 | if (addr) | 313 | if (addr) |
314 | *handle = page_to_dma(dev, page); | 314 | *handle = pfn_to_dma(dev, page_to_pfn(page)); |
315 | 315 | ||
316 | return addr; | 316 | return addr; |
317 | } | 317 | } |
@@ -406,7 +406,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr | |||
406 | if (!arch_is_coherent()) | 406 | if (!arch_is_coherent()) |
407 | __dma_free_remap(cpu_addr, size); | 407 | __dma_free_remap(cpu_addr, size); |
408 | 408 | ||
409 | __dma_free_buffer(dma_to_page(dev, handle), size); | 409 | __dma_free_buffer(pfn_to_page(dma_to_pfn(dev, handle)), size); |
410 | } | 410 | } |
411 | EXPORT_SYMBOL(dma_free_coherent); | 411 | EXPORT_SYMBOL(dma_free_coherent); |
412 | 412 | ||