pinctrl: plgpio: Call clk_disable_unprepare only if clk_prepare_enable is called
Subsystems (2)
PATCH 1/1 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.
--- drivers/pinctrl/spear/pinctrl-plgpio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pinctrl/spear/pinctrl-plgpio.c +2 -1
@@ -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;
Signature · 1 line
1.7.9.5
Quoted 5 lines · Axel Lin
This driver allows
clk_get()failure, and still work without it. This patch adds !IS_ERR(plgpio->clk) checking inplgpio_request()error path so we only callclk_disable_unprepare()ifclk_prepare_enable()is called.Signed-off-by Axel Lin <[email protected]>
Quoted 5 lines · Axel Lin
This driver allows
clk_get()failure, and still work without it. This patch adds !IS_ERR(plgpio->clk) checking inplgpio_request()error path so we only callclk_disable_unprepare()ifclk_prepare_enable()is called.Signed-off-by Axel Lin <[email protected]>
Applied with Viresh's ACK, thanks!
Yours,
Linus Walleij