]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
pinctrl: plgpio: Call clk_disable_unprepare only if clk_prepare_enable is called
authorAxel Lin <axel.lin@ingics.com>
Wed, 14 Nov 2012 08:37:45 +0000 (16:37 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 15 Nov 2012 11:33:11 +0000 (12:33 +0100)
This driver allows clk_get() failure, and still work without it.
This patch adds !IS_ERR(plgpio->clk) checking in plgpio_request() error path
so we only call clk_disable_unprepare() if clk_prepare_enable() is called.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/spear/pinctrl-plgpio.c

index 1044ad3f3c860ae7533042f2326d364e508bcf9c..cf6d9c2049360395bb727570f31c4caaa46669ad 100644 (file)
@@ -243,7 +243,8 @@ static int plgpio_request(struct gpio_chip *chip, unsigned offset)
        return 0;
 
 err1:
-       clk_disable_unprepare(plgpio->clk);
+       if (!IS_ERR(plgpio->clk))
+               clk_disable_unprepare(plgpio->clk);
 err0:
        pinctrl_free_gpio(gpio);
        return ret;