]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/media/platform/coda.c: use gen_pool_dma_alloc() to allocate iram buffer
authorNicolin Chen <b42378@freescale.com>
Tue, 5 Nov 2013 05:56:50 +0000 (16:56 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 5 Nov 2013 05:56:50 +0000 (16:56 +1100)
Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/media/platform/coda.c

index 449d2fec9e87454aa85f34a0642aa61919d376a5..4993610051eeeb586005712060732ef2539390b2 100644 (file)
@@ -3232,13 +3232,12 @@ static int coda_probe(struct platform_device *pdev)
                dev->iram_size = CODA7_IRAM_SIZE;
                break;
        }
-       dev->iram_vaddr = gen_pool_alloc(dev->iram_pool, dev->iram_size);
+       dev->iram_vaddr = (unsigned long)gen_pool_dma_alloc(dev->iram_pool,
+                       dev->iram_size, (dma_addr_t *)&dev->iram_paddr);
        if (!dev->iram_vaddr) {
                dev_err(&pdev->dev, "unable to alloc iram\n");
                return -ENOMEM;
        }
-       dev->iram_paddr = gen_pool_virt_to_phys(dev->iram_pool,
-                                               dev->iram_vaddr);
 
        platform_set_drvdata(pdev, dev);