提交 98040490 编写于 作者: A Axel Lin 提交者: Linus Walleij

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: NAxel Lin <axel.lin@ingics.com>
Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 6f37b1b4
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册