media: coda: Use devm_platform_ioremap_resource()
authorFabio Estevam <festevam@gmail.com>
Wed, 5 Jun 2019 18:05:43 +0000 (14:05 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 21 Jun 2019 21:22:19 +0000 (17:22 -0400)
Use devm_platform_ioremap_resource() to simplify the code a bit.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/coda/coda-common.c

index 751b0be1c2ea3115c82c3c2d0357cdc0092ba1e7..de64040dad8a8cbd6213629fe94195ad71bf1717 100644 (file)
@@ -2814,7 +2814,6 @@ static int coda_probe(struct platform_device *pdev)
        struct device_node *np = pdev->dev.of_node;
        struct gen_pool *pool;
        struct coda_dev *dev;
-       struct resource *res;
        int ret, irq;
 
        dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL);
@@ -2846,8 +2845,7 @@ static int coda_probe(struct platform_device *pdev)
        }
 
        /* Get  memory for physical registers */
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       dev->regs_base = devm_ioremap_resource(&pdev->dev, res);
+       dev->regs_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(dev->regs_base))
                return PTR_ERR(dev->regs_base);