diff options
author | Axel Lin <axel.lin@ingics.com> | 2012-11-14 12:37:45 +0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-11-15 15:33:11 +0400 |
commit | 9804049097af11b4f64a82b0e8c8078b3f2cbada (patch) | |
tree | e7577b2509e0df6518bef68e16e7ee2273eb1fec /drivers/pinctrl/spear | |
parent | 6f37b1b4d407d6abcd24c4519cd892903229cd95 (diff) | |
download | linux-9804049097af11b4f64a82b0e8c8078b3f2cbada.tar.xz |
pinctrl: plgpio: Call clk_disable_unprepare only if clk_prepare_enable is called
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>
Diffstat (limited to 'drivers/pinctrl/spear')
-rw-r--r-- | drivers/pinctrl/spear/pinctrl-plgpio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c index 1044ad3f3c86..cf6d9c204936 100644 --- a/drivers/pinctrl/spear/pinctrl-plgpio.c +++ b/drivers/pinctrl/spear/pinctrl-plgpio.c @@ -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; |