]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: samsung: pcm: Use devm_platform_get_and_ioremap_resource()
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 16 Jun 2021 09:16:50 +0000 (17:16 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 21 Jun 2021 12:06:21 +0000 (13:06 +0100)
Use devm_platform_get_and_ioremap_resource() to simplify
code.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210616091652.2552927-3-yangyingliang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/samsung/pcm.c

index bfd76e9cc0cad6306eac0469d59f01acd21bdba0..4c4dfde0568febe454840bd6decbcb6f2ee35219 100644 (file)
@@ -512,8 +512,7 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
        /* Default is 128fs */
        pcm->sclk_per_fs = 128;
 
-       mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       pcm->regs = devm_ioremap_resource(&pdev->dev, mem_res);
+       pcm->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &mem_res);
        if (IS_ERR(pcm->regs))
                return PTR_ERR(pcm->regs);