mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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 <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
This commit is contained in:
parent
6f37b1b4d4
commit
9804049097
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue