ASoC: rockchip: spdif: Use devm_platform_get_and_ioremap_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Tue, 15 Jun 2021 14:15:02 +0000 (22:15 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 16 Jun 2021 14:41:12 +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-3-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/rockchip/rockchip_spdif.c

index ffb4ec306441d9a92525af9a14a00093db2d0930..73226a46d4890daa34efe060e37b390d68ee97c0 100644 (file)
@@ -313,8 +313,7 @@ static int rk_spdif_probe(struct platform_device *pdev)
        if (IS_ERR(spdif->mclk))
                return PTR_ERR(spdif->mclk);
 
-       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);