pinctrl: rza1: don't manually release devm managed resources
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 5 Oct 2018 19:42:05 +0000 (21:42 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 10 Oct 2018 09:56:21 +0000 (11:56 +0200)
If the probe function fails the driver core cares to return the allocated
resources automatically. So the driver can be simplified accordingly.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-rza1.c

index 8d47bcd670a2ea33ab24c1a81da555b651e7b396..14eb576c04a2b32216d8fb82775022ed0c82037d 100644 (file)
@@ -1284,7 +1284,7 @@ static int rza1_gpio_register(struct rza1_pinctrl *rza1_pctl)
                ret = rza1_parse_gpiochip(rza1_pctl, child, &gpio_chips[i],
                                          &gpio_ranges[i]);
                if (ret)
-                       goto gpiochip_remove;
+                       return ret;
 
                ++i;
        }
@@ -1292,12 +1292,6 @@ static int rza1_gpio_register(struct rza1_pinctrl *rza1_pctl)
        dev_info(rza1_pctl->dev, "Registered %u gpio controllers\n", i);
 
        return 0;
-
-gpiochip_remove:
-       for (; i > 0; i--)
-               devm_gpiochip_remove(rza1_pctl->dev, &gpio_chips[i - 1]);
-
-       return ret;
 }
 
 /**