Skip to content

Commit

Permalink
arch/arm/mach-davinci/sram.c: use gen_pool_dma_alloc() to sram.c
Browse files Browse the repository at this point in the history
Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.

Signed-off-by: Nicolin Chen <[email protected]>
Cc: Sekhar Nori <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Russell King <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Nicolin Chen authored and torvalds committed Nov 13, 2013
1 parent 684f0d3 commit 66f1196
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions arch/arm/mach-davinci/sram.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,14 @@ struct gen_pool *sram_get_gen_pool(void)

void *sram_alloc(size_t len, dma_addr_t *dma)
{
unsigned long vaddr;
dma_addr_t dma_base = davinci_soc_info.sram_dma;

if (dma)
*dma = 0;
if (!sram_pool || (dma && !dma_base))
return NULL;

vaddr = gen_pool_alloc(sram_pool, len);
if (!vaddr)
return NULL;

if (dma)
*dma = gen_pool_virt_to_phys(sram_pool, vaddr);
return (void *)vaddr;
return gen_pool_dma_alloc(sram_pool, len, dma);

}
EXPORT_SYMBOL(sram_alloc);
Expand Down

0 comments on commit 66f1196

Please sign in to comment.