ASoC: tegra: use devm_platform_ioremap_resource() to simplify code
authorYueHaibing <yuehaibing@huawei.com>
Wed, 4 Sep 2019 08:39:09 +0000 (16:39 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 4 Sep 2019 12:48:50 +0000 (13:48 +0100)
Use devm_platform_ioremap_resource() to simplify the code a bit.
This is detected by coccinelle.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20190904083909.18804-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/tegra/tegra30_ahub.c

index 952381260dc3799b07d64739141d7354b9ae1316..635eacbd28d473f2711e227d3706a2b462619537 100644 (file)
@@ -511,7 +511,7 @@ static int tegra30_ahub_probe(struct platform_device *pdev)
        const struct tegra30_ahub_soc_data *soc_data;
        struct reset_control *rst;
        int i;
-       struct resource *res0, *res1;
+       struct resource *res0;
        void __iomem *regs_apbif, *regs_ahub;
        int ret = 0;
 
@@ -587,8 +587,7 @@ static int tegra30_ahub_probe(struct platform_device *pdev)
        }
        regcache_cache_only(ahub->regmap_apbif, true);
 
-       res1 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-       regs_ahub = devm_ioremap_resource(&pdev->dev, res1);
+       regs_ahub = devm_platform_ioremap_resource(pdev, 1);
        if (IS_ERR(regs_ahub))
                return PTR_ERR(regs_ahub);