ASoC: sprd: Use devm_platform_get_and_ioremap_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Thu, 17 Jun 2021 03:32:37 +0000 (11:32 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 17 Jun 2021 12:47:05 +0000 (13:47 +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/20210617033237.605808-1-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sprd/sprd-mcdt.c

index 34b2ce733b5425082b52dc76ef8b0ec71bd0ebf8..f6a55fa60c1bc0cc4e8c340eaf9631a6b2c7b161 100644 (file)
@@ -949,8 +949,7 @@ static int sprd_mcdt_probe(struct platform_device *pdev)
        if (!mcdt)
                return -ENOMEM;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       mcdt->base = devm_ioremap_resource(&pdev->dev, res);
+       mcdt->base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
        if (IS_ERR(mcdt->base))
                return PTR_ERR(mcdt->base);