Commit 5b3e3606 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Vinod Koul

dmaengine: uniphier-mdmac: use devm_platform_ioremap_resource()

Replace the chain of platform_get_resource() and devm_ioremap_resource()
with devm_platform_ioremap_resource().

This allows to remove the local variable for (struct resource *), and
have one function call less.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Link: https://lore.kernel.org/r/20190905034133.29514-1-yamada.masahiro@socionext.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 54ecb8f7
...@@ -382,7 +382,6 @@ static int uniphier_mdmac_probe(struct platform_device *pdev) ...@@ -382,7 +382,6 @@ static int uniphier_mdmac_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct uniphier_mdmac_device *mdev; struct uniphier_mdmac_device *mdev;
struct dma_device *ddev; struct dma_device *ddev;
struct resource *res;
int nr_chans, ret, i; int nr_chans, ret, i;
nr_chans = platform_irq_count(pdev); nr_chans = platform_irq_count(pdev);
...@@ -398,8 +397,7 @@ static int uniphier_mdmac_probe(struct platform_device *pdev) ...@@ -398,8 +397,7 @@ static int uniphier_mdmac_probe(struct platform_device *pdev)
if (!mdev) if (!mdev)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); mdev->reg_base = devm_platform_ioremap_resource(pdev, 0);
mdev->reg_base = devm_ioremap_resource(dev, res);
if (IS_ERR(mdev->reg_base)) if (IS_ERR(mdev->reg_base))
return PTR_ERR(mdev->reg_base); return PTR_ERR(mdev->reg_base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment