media: mtk-vpu: Use devm_platform_ioremap_resource_byname
authorDing Senjie <dingsenjie@yulong.com>
Fri, 14 May 2021 12:35:21 +0000 (14:35 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 2 Jun 2021 11:29:03 +0000 (13:29 +0200)
Use the devm_platform_ioremap_resource_byname() helper instead of
calling platform_get_resource_byname() and devm_ioremap_resource()
separately.

Signed-off-by: Ding Senjie <dingsenjie@yulong.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/mtk-vpu/mtk_vpu.c

index c8a56271b259eec0693cd302d5c1ef532e40011d..ef458b417fa73eae45e08946a5d5f1dc829475fb 100644 (file)
@@ -821,13 +821,11 @@ static int mtk_vpu_probe(struct platform_device *pdev)
                return -ENOMEM;
 
        vpu->dev = &pdev->dev;
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "tcm");
-       vpu->reg.tcm = devm_ioremap_resource(dev, res);
+       vpu->reg.tcm = devm_platform_ioremap_resource_byname(pdev, "tcm");
        if (IS_ERR((__force void *)vpu->reg.tcm))
                return PTR_ERR((__force void *)vpu->reg.tcm);
 
-       res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg_reg");
-       vpu->reg.cfg = devm_ioremap_resource(dev, res);
+       vpu->reg.cfg = devm_platform_ioremap_resource_byname(pdev, "cfg_reg");
        if (IS_ERR((__force void *)vpu->reg.cfg))
                return PTR_ERR((__force void *)vpu->reg.cfg);