[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:48 PDT 2022


On Tue, Oct 4, 2022 at 9:16 AM Linus Walleij <linus.walleij at linaro.org> wrote:

> 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.

devm_clk_get() I mean.

Yours,
Linus Walleij



More information about the Linux-rockchip mailing list