drivers/pinctrl: don't check resource with devm_ioremap_resource
authorWolfram Sang <wsa@the-dreams.de>
Fri, 10 May 2013 08:17:03 +0000 (10:17 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Sun, 16 Jun 2013 09:56:49 +0000 (11:56 +0200)
devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-at91.c

index 5d7529ed5392d843cb80371cd47b45fb32e9a7b2..b90a3a0ac53432af15a64849a115823de0fedd9b 100644 (file)
@@ -1543,12 +1543,6 @@ static int at91_gpio_probe(struct platform_device *pdev)
                goto err;
        }
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               ret = -ENOENT;
-               goto err;
-       }
-
        irq = platform_get_irq(pdev, 0);
        if (irq < 0) {
                ret = irq;
@@ -1561,6 +1555,7 @@ static int at91_gpio_probe(struct platform_device *pdev)
                goto err;
        }
 
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        at91_chip->regbase = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(at91_chip->regbase)) {
                ret = PTR_ERR(at91_chip->regbase);