ASoC: rockchip: pdm: Use devm_platform_get_and_ioremap_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 15 Jun 2021 14:15:01 +0000 (22:15 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 16 Jun 2021 14:41:11 +0000 (15:41 +0100)
Use devm_platform_get_and_ioremap_resource() to simplify
code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20210615141502.1683686-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/rockchip/rockchip_pdm.c

index 9295d64..38bd603 100644 (file)
@@ -495,8 +495,7 @@ static int rockchip_pdm_probe(struct platform_device *pdev)
                        return PTR_ERR(pdm->reset);
        }
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       regs = devm_ioremap_resource(&pdev->dev, res);
+       regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
        if (IS_ERR(regs))
                return PTR_ERR(regs);