[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <h6azhlugyd5vx7pwrdjg2my7h2gj4uadkv4e535y32or7r3jwi@7vo7wum5lo5r>
Date: Fri, 23 Aug 2024 12:03:12 +0300
From: Serge Semin <fancer.lancer@...il.com>
To: Wu Bo <bo.wu@...o.com>
Cc: linux-kernel@...r.kernel.org, linux-mips@...r.kernel.org,
Wu Bo <wubo.oduw@...il.com>
Subject: Re: [PATCH] bus: bt1-axi: change to use devm_clk_get_enabled()
helpers
On Fri, Aug 23, 2024 at 11:56:55AM +0300, Serge Semin wrote:
> Hi Wu
>
> On Thu, Aug 22, 2024 at 08:31:03PM -0600, Wu Bo wrote:
> > Make the code cleaner and avoid call clk_disable_unprepare()
> >
> > Signed-off-by: Wu Bo <bo.wu@...o.com>
>
> Awesome! Thanks.
>
> Acked-by: Serge Semin <fancer.lancer@...il.com>
>
> Could you also apply the same change to drivers/bus/bt1-apb.c ?
Grrr, too fast. Please see my further note.
>
> -Serge(y)
>
> > ---
> > drivers/bus/bt1-axi.c | 19 +------------------
> > 1 file changed, 1 insertion(+), 18 deletions(-)
> >
> > diff --git a/drivers/bus/bt1-axi.c b/drivers/bus/bt1-axi.c
> > index 4007e7322cf2..b0baae49aca6 100644
> > --- a/drivers/bus/bt1-axi.c
> > +++ b/drivers/bus/bt1-axi.c
> > @@ -146,32 +146,15 @@ static int bt1_axi_request_rst(struct bt1_axi *axi)
> > return ret;
> > }
> >
> > -static void bt1_axi_disable_clk(void *data)
> > -{
> > - struct bt1_axi *axi = data;
> > -
> > - clk_disable_unprepare(axi->aclk);
> > -}
> > -
> > static int bt1_axi_request_clk(struct bt1_axi *axi)
> > {
> > int ret;
> >
> > - axi->aclk = devm_clk_get(axi->dev, "aclk");
> > + axi->aclk = devm_clk_get_enabled(axi->dev, "aclk");
> > if (IS_ERR(axi->aclk))
> > return dev_err_probe(axi->dev, PTR_ERR(axi->aclk),
> > "Couldn't get AXI Interconnect clock\n");
> >
> > - ret = clk_prepare_enable(axi->aclk);
> > - if (ret) {
> > - dev_err(axi->dev, "Couldn't enable the AXI clock\n");
> > - return ret;
> > - }
> > -
> > - ret = devm_add_action_or_reset(axi->dev, bt1_axi_disable_clk, axi);
> > - if (ret)
> > - dev_err(axi->dev, "Can't add AXI clock disable action\n");
> > -
> > return ret;
This will lead to the undefined value returned. Please drop the "ret"
variable and just return 0 in the last statement. After that feel free
to add my Ab-tag.
-Serge(y)
> > }
> >
> > --
> > 2.25.1
> >
Powered by blists - more mailing lists