[PATCH 1/2] clk: Add a devm variant of clk_rate_exclusive_get()

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Mon Dec 18 05:01:41 PST 2023


[Cc += Maxime]

Hello Stephen,

On Sun, Dec 17, 2023 at 04:17:41PM -0800, Stephen Boyd wrote:
> Quoting Uwe Kleine-König (2023-12-12 10:09:42)
> > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> > index af2011c2a93b..78249ca2341c 100644
> > --- a/drivers/clk/clk.c
> > +++ b/drivers/clk/clk.c
> > @@ -937,6 +937,21 @@ void clk_rate_exclusive_get(struct clk *clk)
> >  }
> >  EXPORT_SYMBOL_GPL(clk_rate_exclusive_get);
> >  
> > +static void devm_clk_rate_exclusive_put(void *data)
> > +{
> > +       struct clk *clk = data;
> > +
> > +       clk_rate_exclusive_put(clk);
> > +}
> > +
> > +int devm_clk_rate_exclusive_get(struct device *dev, struct clk *clk)
> > +{
> > +       clk_rate_exclusive_get(clk);
> 
> It seems the other thread wants this to return an error value.

The status quo is that clk_rate_exclusive_get() always returns zero.
Some users do error handling (which is dead code until Maxime reworks
the call that it might return something non-zero), others just call it
without checking.

If you don't require to add something like:

	ret = clk_rate_exclusive_get(clk);
	if (ret)
		return ret;

where we currently have just

	clk_rate_exclusive_get(clk);

the patch can just be applied (using git am -3) not even hitting a merge
conflict without that other series.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20231218/aaf6ba73/attachment-0001.sig>


More information about the linux-arm-kernel mailing list