Skip to content

Commit

Permalink
dma: replace devm_request_and_ioremap by devm_ioremap_resource
Browse files Browse the repository at this point in the history
Use devm_ioremap_resource instead of devm_request_and_ioremap.

This was done using the semantic patch
scripts/coccinelle/api/devm_ioremap_resource.cocci

The relevant call to platform_get_resource was manually moved down to the
call to devm_ioremap_resource.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Julia Lawall authored and Vinod Koul committed Sep 2, 2013
1 parent 2ec7e2e commit 4770ee4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/dma/sh/sudmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,8 @@ static int sudmac_probe(struct platform_device *pdev)
if (!pdata)
return -ENODEV;

chan = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (!chan || !irq_res)
if (!irq_res)
return -ENODEV;

err = -ENOMEM;
Expand All @@ -360,9 +359,10 @@ static int sudmac_probe(struct platform_device *pdev)

dma_dev = &su_dev->shdma_dev.dma_dev;

su_dev->chan_reg = devm_request_and_ioremap(&pdev->dev, chan);
if (!su_dev->chan_reg)
return err;
chan = platform_get_resource(pdev, IORESOURCE_MEM, 0);
su_dev->chan_reg = devm_ioremap_resource(&pdev->dev, chan);
if (IS_ERR(su_dev->chan_reg))
return PTR_ERR(su_dev->chan_reg);

dma_cap_set(DMA_SLAVE, dma_dev->cap_mask);

Expand Down

0 comments on commit 4770ee4

Please sign in to comment.