]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: sunxi: sun4i-codec: Use devm_platform_get_and_ioremap_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 17 Jun 2021 04:50:10 +0000 (12:50 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 21 Jun 2021 12:04:16 +0000 (13:04 +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/20210617045012.1119650-2-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sunxi/sun4i-codec.c

index 6f3d9148a18579c4d9e66a6be30d3020ef2770f3..da597e456beb253027fa88c34b8f350af01aa438 100644 (file)
@@ -1709,8 +1709,7 @@ static int sun4i_codec_probe(struct platform_device *pdev)
 
        scodec->dev = &pdev->dev;
 
-       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 PTR_ERR(base);