提交 43f950f4 编写于 作者: N Nicolin Chen 提交者: Linus Torvalds

drivers/media/platform/coda.c: use gen_pool_dma_alloc() to allocate iram buffer

Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.
Signed-off-by: NNicolin Chen <b42378@freescale.com>
Acked-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 a6dd30e2
...@@ -3232,13 +3232,12 @@ static int coda_probe(struct platform_device *pdev) ...@@ -3232,13 +3232,12 @@ static int coda_probe(struct platform_device *pdev)
dev->iram_size = CODA7_IRAM_SIZE; dev->iram_size = CODA7_IRAM_SIZE;
break; 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) { if (!dev->iram_vaddr) {
dev_err(&pdev->dev, "unable to alloc iram\n"); dev_err(&pdev->dev, "unable to alloc iram\n");
return -ENOMEM; return -ENOMEM;
} }
dev->iram_paddr = gen_pool_virt_to_phys(dev->iram_pool,
dev->iram_vaddr);
platform_set_drvdata(pdev, dev); platform_set_drvdata(pdev, dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册