From: Nicolin Chen Date: Tue, 12 Nov 2013 23:09:57 +0000 (-0800) Subject: drivers/uio/uio_pruss.c: use gen_pool_dma_alloc() to allocate sram memory X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=288342e9cc867421d20f940d0c06b7aa4bf39096;p=openwrt%2Fstaging%2Fblogic.git 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: Nicolin Chen Cc: "Hans J. Koch" Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c index f519da9034b7..96c4a19b1918 100644 --- a/drivers/uio/uio_pruss.c +++ b/drivers/uio/uio_pruss.c @@ -158,14 +158,12 @@ static int pruss_probe(struct platform_device *dev) if (pdata->sram_pool) { gdev->sram_pool = pdata->sram_pool; 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) { dev_err(&dev->dev, "Could not allocate SRAM pool\n"); 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,