[media] coda: use devm_ioremap_resource
authorPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 21 May 2013 07:19:27 +0000 (04:19 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 27 May 2013 12:31:59 +0000 (09:31 -0300)
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/coda.c

index d64908a74000e38be1133de599ff78670d60c9ba..421230732051c636d66df35f71d7b67af8d4cc05 100644 (file)
@@ -1976,17 +1976,9 @@ static int coda_probe(struct platform_device *pdev)
                return -ENOENT;
        }
 
-       if (devm_request_mem_region(&pdev->dev, res->start,
-                       resource_size(res), CODA_NAME) == NULL) {
-               dev_err(&pdev->dev, "failed to request memory region\n");
-               return -ENOENT;
-       }
-       dev->regs_base = devm_ioremap(&pdev->dev, res->start,
-                                     resource_size(res));
-       if (!dev->regs_base) {
-               dev_err(&pdev->dev, "failed to ioremap address region\n");
-               return -ENOENT;
-       }
+       dev->regs_base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(dev->regs_base))
+               return PTR_ERR(dev->regs_base);
 
        /* IRQ */
        irq = platform_get_irq(pdev, 0);