[PATCH 15/20] gpio/rockchip: disable and put clocks when gpiolib register failed

Linus Walleij linus.walleij at linaro.org
Tue Oct 4 00:16:19 PDT 2022


On Tue, Sep 20, 2022 at 12:31 PM Jianqun Xu <jay.xu at rock-chips.com> wrote:

> When gpiolib register failed, the clocks should be disabled and put.
>
> Signed-off-by: Jianqun Xu <jay.xu at rock-chips.com>
(...)
> +err_put_clk:
> +       clk_put(bank->clk);
> +       clk_put(bank->db_clk);
> +       clk_disable_unprepare(bank->clk);
> +       clk_disable_unprepare(bank->db_clk);

Always clk_disable_unprepare() before clk_put().

I think you can drop clk_put() if you switch to devres dev_clk_get()
instead.

Yours,
Linus Walleij



More information about the Linux-rockchip mailing list