Commit 288342e9 authored by Nicolin Chen's avatar Nicolin Chen Committed by Linus Torvalds

drivers/uio/uio_pruss.c: use gen_pool_dma_alloc() to allocate sram memory

Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.
Signed-off-by: default avatarNicolin Chen <b42378@freescale.com>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 43f950f4
...@@ -158,14 +158,12 @@ static int pruss_probe(struct platform_device *dev) ...@@ -158,14 +158,12 @@ static int pruss_probe(struct platform_device *dev)
if (pdata->sram_pool) { if (pdata->sram_pool) {
gdev->sram_pool = pdata->sram_pool; gdev->sram_pool = pdata->sram_pool;
gdev->sram_vaddr = gdev->sram_vaddr =
gen_pool_alloc(gdev->sram_pool, sram_pool_sz); (unsigned long)gen_pool_dma_alloc(gdev->sram_pool,
sram_pool_sz, &gdev->sram_paddr);
if (!gdev->sram_vaddr) { if (!gdev->sram_vaddr) {
dev_err(&dev->dev, "Could not allocate SRAM pool\n"); dev_err(&dev->dev, "Could not allocate SRAM pool\n");
goto out_free; goto out_free;
} }
gdev->sram_paddr =
gen_pool_virt_to_phys(gdev->sram_pool,
gdev->sram_vaddr);
} }
gdev->ddr_vaddr = dma_alloc_coherent(&dev->dev, extram_pool_sz, gdev->ddr_vaddr = dma_alloc_coherent(&dev->dev, extram_pool_sz,
......
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