Commit 66f11969 authored by Nicolin Chen's avatar Nicolin Chen Committed by Linus Torvalds

arch/arm/mach-davinci/sram.c: use gen_pool_dma_alloc() to sram.c

Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.
Signed-off-by: default avatarNicolin Chen <b42378@freescale.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 684f0d3d
...@@ -25,7 +25,6 @@ struct gen_pool *sram_get_gen_pool(void) ...@@ -25,7 +25,6 @@ struct gen_pool *sram_get_gen_pool(void)
void *sram_alloc(size_t len, dma_addr_t *dma) void *sram_alloc(size_t len, dma_addr_t *dma)
{ {
unsigned long vaddr;
dma_addr_t dma_base = davinci_soc_info.sram_dma; dma_addr_t dma_base = davinci_soc_info.sram_dma;
if (dma) if (dma)
...@@ -33,13 +32,7 @@ void *sram_alloc(size_t len, dma_addr_t *dma) ...@@ -33,13 +32,7 @@ void *sram_alloc(size_t len, dma_addr_t *dma)
if (!sram_pool || (dma && !dma_base)) if (!sram_pool || (dma && !dma_base))
return NULL; return NULL;
vaddr = gen_pool_alloc(sram_pool, len); return gen_pool_dma_alloc(sram_pool, len, dma);
if (!vaddr)
return NULL;
if (dma)
*dma = gen_pool_virt_to_phys(sram_pool, vaddr);
return (void *)vaddr;
} }
EXPORT_SYMBOL(sram_alloc); EXPORT_SYMBOL(sram_alloc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment