summaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2012-11-14 16:37:45 +0800
committerLinus Walleij <linus.walleij@linaro.org>2012-11-15 12:33:11 +0100
commit9804049097af11b4f64a82b0e8c8078b3f2cbada (patch)
treee7577b2509e0df6518bef68e16e7ee2273eb1fec /drivers/pinctrl
parent6f37b1b4d407d6abcd24c4519cd892903229cd95 (diff)
downloadop-kernel-dev-9804049097af11b4f64a82b0e8c8078b3f2cbada.zip
op-kernel-dev-9804049097af11b4f64a82b0e8c8078b3f2cbada.tar.gz
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')
-rw-r--r--drivers/pinctrl/spear/pinctrl-plgpio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c
index 1044ad3..cf6d9c2 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;
OpenPOWER on IntegriCloud