ASoC: mediatek: mt8186: Convert to devm_platform_ioremap_resource()
authorYangtao Li <frank.li@vivo.com>
Tue, 11 Jul 2023 03:48:43 +0000 (11:48 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 17 Jul 2023 05:15:55 +0000 (06:15 +0100)
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
Link: https://lore.kernel.org/r/20230711034846.69437-3-frank.li@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c

index a868a04ed4e7af15a0f7de48ae434ad36bb3ef25..b86159f70a33a2b18b4c4867584c617d579d8963 100644 (file)
@@ -2815,7 +2815,6 @@ static int mt8186_afe_pcm_dev_probe(struct platform_device *pdev)
 {
        struct mtk_base_afe *afe;
        struct mt8186_afe_private *afe_priv;
-       struct resource *res;
        struct reset_control *rstc;
        struct device *dev = &pdev->dev;
        int i, ret, irq_id;
@@ -2836,8 +2835,7 @@ static int mt8186_afe_pcm_dev_probe(struct platform_device *pdev)
        afe_priv = afe->platform_priv;
        afe->dev = &pdev->dev;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       afe->base_addr = devm_ioremap_resource(dev, res);
+       afe->base_addr = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(afe->base_addr))
                return PTR_ERR(afe->base_addr);