ASoC: sunxi: use devm_platform_get_and_ioremap_resource()
authorMinghao Chi <chi.minghao@zte.com.cn>
Fri, 11 Nov 2022 08:41:51 +0000 (16:41 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 14 Nov 2022 11:30:31 +0000 (11:30 +0000)
Convert platform_get_resource(), devm_ioremap_resource() to a single
call to devm_platform_get_and_ioremap_resource(), as this is exactly
what this function does.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Acked-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/202211111641514826535@zte.com.cn
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sunxi/sun50i-dmic.c

index 62509cb02995521bbd2c64b81675a1f094e5e27b..069c993acb316bddaf6a36be468351e5bf2565c4 100644 (file)
@@ -317,8 +317,7 @@ static int sun50i_dmic_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        /* Get the addresses */
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       base = devm_ioremap_resource(&pdev->dev, res);
+       base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
        if (IS_ERR(base))
                return dev_err_probe(&pdev->dev, PTR_ERR(base),
                                     "get resource failed.\n");