pinctrl: tz1090: Convert to devm_ioremap_resource
authorAxel Lin <axel.lin@ingics.com>
Mon, 26 Aug 2013 02:21:44 +0000 (10:21 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 28 Aug 2013 11:34:19 +0000 (13:34 +0200)
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-tz1090.c

index 4edae08a0a61754d5694b983fcfc99ccdcb49d1d..72d955252e415f67187f35e3b2992f4165784d93 100644 (file)
@@ -1996,25 +1996,9 @@ static int tz1090_pinctrl_probe(struct platform_device *pdev)
        tz1090_pinctrl_desc.npins = ARRAY_SIZE(tz1090_pins);
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(&pdev->dev, "Missing MEM resource\n");
-               return -ENODEV;
-       }
-
-       if (!devm_request_mem_region(&pdev->dev, res->start,
-                                    resource_size(res),
-                                    dev_name(&pdev->dev))) {
-               dev_err(&pdev->dev,
-                       "Couldn't request MEM resource\n");
-               return -ENODEV;
-       }
-
-       pmx->regs = devm_ioremap(&pdev->dev, res->start,
-                                resource_size(res));
-       if (!pmx->regs) {
-               dev_err(&pdev->dev, "Couldn't ioremap regs\n");
-               return -ENODEV;
-       }
+       pmx->regs = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(pmx->regs))
+               return PTR_ERR(pmx->regs);
 
        pmx->pctl = pinctrl_register(&tz1090_pinctrl_desc, &pdev->dev, pmx);
        if (!pmx->pctl) {