staging: imx-drm: use devm_ioremap_resource()
authorLaurent Navet <laurent.navet@gmail.com>
Thu, 2 May 2013 11:41:41 +0000 (13:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2013 22:42:30 +0000 (15:42 -0700)
Replace a call to deprecated devm_request_and_ioremap by devm_ioremap_resource.

Found with coccicheck and this semantic patch:
 scripts/coccinelle/api/devm_request_and_ioremap.cocci.

Signed-off-by: Laurent Navet <laurent.navet@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/imx-drm/imx-tve.c

index ac16344..a6efa8f 100644 (file)
@@ -638,11 +638,9 @@ static int imx_tve_probe(struct platform_device *pdev)
                return -ENOENT;
        }
 
-       base = devm_request_and_ioremap(&pdev->dev, res);
-       if (!base) {
-               dev_err(&pdev->dev, "failed to remap memory region\n");
-               return -ENOENT;
-       }
+       base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(base))
+               return PTR_ERR(base);
 
        tve_regmap_config.lock_arg = tve;
        tve->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "tve", base,