diff options
author | Nicolin Chen <b42378@freescale.com> | 2013-11-12 18:09:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:22 -0500 |
commit | 66f119695bcccc2b03b354152f6d65a0b129cef9 (patch) | |
tree | f387dd78f82f711c4ceaa75f6aba5458968602aa /arch | |
parent | 684f0d3d14f2744ae7ad79063b21909e32bf444e (diff) |
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: Nicolin 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-davinci/sram.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/arch/arm/mach-davinci/sram.c b/arch/arm/mach-davinci/sram.c index f18928b073f5..8540dddf1fbd 100644 --- a/arch/arm/mach-davinci/sram.c +++ b/arch/arm/mach-davinci/sram.c | |||
@@ -25,7 +25,6 @@ struct gen_pool *sram_get_gen_pool(void) | |||
25 | 25 | ||
26 | void *sram_alloc(size_t len, dma_addr_t *dma) | 26 | void *sram_alloc(size_t len, dma_addr_t *dma) |
27 | { | 27 | { |
28 | unsigned long vaddr; | ||
29 | dma_addr_t dma_base = davinci_soc_info.sram_dma; | 28 | dma_addr_t dma_base = davinci_soc_info.sram_dma; |
30 | 29 | ||
31 | if (dma) | 30 | if (dma) |
@@ -33,13 +32,7 @@ void *sram_alloc(size_t len, dma_addr_t *dma) | |||
33 | if (!sram_pool || (dma && !dma_base)) | 32 | if (!sram_pool || (dma && !dma_base)) |
34 | return NULL; | 33 | return NULL; |
35 | 34 | ||
36 | vaddr = gen_pool_alloc(sram_pool, len); | 35 | return gen_pool_dma_alloc(sram_pool, len, dma); |
37 | if (!vaddr) | ||
38 | return NULL; | ||
39 | |||
40 | if (dma) | ||
41 | *dma = gen_pool_virt_to_phys(sram_pool, vaddr); | ||
42 | return (void *)vaddr; | ||
43 | 36 | ||
44 | } | 37 | } |
45 | EXPORT_SYMBOL(sram_alloc); | 38 | EXPORT_SYMBOL(sram_alloc); |