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

From: Linus Walleij
Date: Tue Oct 04 2022 - 03:17:16 EST


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

> On Tue, Sep 20, 2022 at 12:31 PM Jianqun Xu <jay.xu@xxxxxxxxxxxxxx> wrote:
>
> > When gpiolib register failed, the clocks should be disabled and put.
> >
> > Signed-off-by: Jianqun Xu <jay.xu@xxxxxxxxxxxxxx>
> (...)
> > +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