OSDN Git Service

media: cec: s5p_cec: Make use of the helper function devm_platform_ioremap_resource()
authorCai Huoqing <caihuoqing@baidu.com>
Wed, 1 Sep 2021 05:48:42 +0000 (07:48 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 30 Sep 2021 08:07:49 +0000 (10:07 +0200)
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/cec/platform/s5p/s5p_cec.c

index 028a09a..ce9a9d9 100644 (file)
@@ -178,7 +178,6 @@ static int s5p_cec_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device *hdmi_dev;
-       struct resource *res;
        struct s5p_cec_dev *cec;
        bool needs_hpd = of_property_read_bool(pdev->dev.of_node, "needs-hpd");
        int ret;
@@ -212,8 +211,7 @@ static int s5p_cec_probe(struct platform_device *pdev)
        if (IS_ERR(cec->pmu))
                return -EPROBE_DEFER;
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       cec->reg = devm_ioremap_resource(dev, res);
+       cec->reg = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(cec->reg))
                return PTR_ERR(cec->reg);