Skip to content

Commit

Permalink
drivers/media/platform/coda.c: use gen_pool_dma_alloc() to allocate i…
Browse files Browse the repository at this point in the history
…ram buffer

Since gen_pool_dma_alloc() is introduced, we implement it to simplify code.

Signed-off-by: Nicolin Chen <b42378@freescale.com>
Acked-by: 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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Nicolin Chen authored and Linus Torvalds committed Nov 13, 2013
1 parent a6dd30e commit 43f950f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/media/platform/coda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 43f950f

Please sign in to comment.