public inbox for linux-clk@vger.kernel.org
 help / color / mirror / Atom feed
* Of clk_hw_unregister_fractional_divider
@ 2024-10-09  0:54 Dr. David Alan Gilbert
  2024-10-09 20:29 ` Stephen Boyd
  0 siblings, 1 reply; 4+ messages in thread
From: Dr. David Alan Gilbert @ 2024-10-09  0:54 UTC (permalink / raw)
  To: mturquette, sboyd; +Cc: linux-clk

Hi,
  One of my scripts noticed that clk_hw_unregister_fractional_divider
was unused and I was thinking of dead coding it, but thought it worth
asking whether it's actually a missing call to it.

  It was added in 2016 by:

commit 39b44cff4ad4af6d7abd9dd2acb288b005c26503
Author: Stephen Boyd <sboyd@codeaurora.org>
Date:   Sun Feb 7 00:15:09 2016 -0800

    clk: fractional-divider: Add hw based registration APIs
    
and I can see clk_hw_register_fractional_divider is called from
clk_register_fractional_divider.

Is that just consequence of them being system devices that never
get unregistered or something else?

Thanks,

Dave

-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Of clk_hw_unregister_fractional_divider
  2024-10-09  0:54 Of clk_hw_unregister_fractional_divider Dr. David Alan Gilbert
@ 2024-10-09 20:29 ` Stephen Boyd
  2024-10-10  0:58   ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Boyd @ 2024-10-09 20:29 UTC (permalink / raw)
  To: Dr. David Alan Gilbert, mturquette; +Cc: linux-clk

Quoting Dr. David Alan Gilbert (2024-10-08 17:54:24)
> Hi,
>   One of my scripts noticed that clk_hw_unregister_fractional_divider
> was unused and I was thinking of dead coding it, but thought it worth
> asking whether it's actually a missing call to it.
> 
>   It was added in 2016 by:
> 
> commit 39b44cff4ad4af6d7abd9dd2acb288b005c26503
> Author: Stephen Boyd <sboyd@codeaurora.org>
> Date:   Sun Feb 7 00:15:09 2016 -0800
> 
>     clk: fractional-divider: Add hw based registration APIs
>     
> and I can see clk_hw_register_fractional_divider is called from
> clk_register_fractional_divider.
> 
> Is that just consequence of them being system devices that never
> get unregistered or something else?
> 

I don't know what you mean by system devices.

The clk_hw prefixed functions and clk_hw based APIs should be used
instead of struct clk APIs for clk providers in general. I'd accept a
patch that migrates the two calls to clk_register_fractional_divider()
with a call to clk_hw_register_fractional_divider() instead. If that's
done we can remove clk_register_fractional_divider(), which is the
overall plan but nobody got around to it so far.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Of clk_hw_unregister_fractional_divider
  2024-10-09 20:29 ` Stephen Boyd
@ 2024-10-10  0:58   ` Dr. David Alan Gilbert
  2024-10-10  1:23     ` Stephen Boyd
  0 siblings, 1 reply; 4+ messages in thread
From: Dr. David Alan Gilbert @ 2024-10-10  0:58 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: mturquette, linux-clk

* Stephen Boyd (sboyd@kernel.org) wrote:
> Quoting Dr. David Alan Gilbert (2024-10-08 17:54:24)
> > Hi,
> >   One of my scripts noticed that clk_hw_unregister_fractional_divider
> > was unused and I was thinking of dead coding it, but thought it worth
> > asking whether it's actually a missing call to it.
> > 
> >   It was added in 2016 by:
> > 
> > commit 39b44cff4ad4af6d7abd9dd2acb288b005c26503
> > Author: Stephen Boyd <sboyd@codeaurora.org>
> > Date:   Sun Feb 7 00:15:09 2016 -0800
> > 
> >     clk: fractional-divider: Add hw based registration APIs
> >     
> > and I can see clk_hw_register_fractional_divider is called from
> > clk_register_fractional_divider.
> > 
> > Is that just consequence of them being system devices that never
> > get unregistered or something else?
> > 
> 
> I don't know what you mean by system devices.

I mean something that can't get unplugged/removed.

> The clk_hw prefixed functions and clk_hw based APIs should be used
> instead of struct clk APIs for clk providers in general. I'd accept a
> patch that migrates the two calls to clk_register_fractional_divider()
> with a call to clk_hw_register_fractional_divider() instead. If that's
> done we can remove clk_register_fractional_divider(), which is the
> overall plan but nobody got around to it so far.

Oh hmm, that doesn't look too hard for those two - although I'm not sure
I have a way of testing it?

However, my question was about the clk_hw_*un*register_fractional_divider
- I can see the clk_register_fractional_divider can be replaced by
clk_hw_register_fractional_divider - but would there need to be
a call to the unregister somewhere? (Which is what my script noticed
there's no callers of).

Dave

-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Of clk_hw_unregister_fractional_divider
  2024-10-10  0:58   ` Dr. David Alan Gilbert
@ 2024-10-10  1:23     ` Stephen Boyd
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Boyd @ 2024-10-10  1:23 UTC (permalink / raw)
  To: Dr. David Alan Gilbert; +Cc: mturquette, linux-clk

Quoting Dr. David Alan Gilbert (2024-10-09 17:58:21)
> * Stephen Boyd (sboyd@kernel.org) wrote:
> > Quoting Dr. David Alan Gilbert (2024-10-08 17:54:24)
> > > Hi,
> > >   One of my scripts noticed that clk_hw_unregister_fractional_divider
> > > was unused and I was thinking of dead coding it, but thought it worth
> > > asking whether it's actually a missing call to it.
> > > 
> > >   It was added in 2016 by:
> > > 
> > > commit 39b44cff4ad4af6d7abd9dd2acb288b005c26503
> > > Author: Stephen Boyd <sboyd@codeaurora.org>
> > > Date:   Sun Feb 7 00:15:09 2016 -0800
> > > 
> > >     clk: fractional-divider: Add hw based registration APIs
> > >     
> > > and I can see clk_hw_register_fractional_divider is called from
> > > clk_register_fractional_divider.
> > > 
> > > Is that just consequence of them being system devices that never
> > > get unregistered or something else?
> > > 
> > 
> > I don't know what you mean by system devices.
> 
> I mean something that can't get unplugged/removed.

Ok.

> 
> > The clk_hw prefixed functions and clk_hw based APIs should be used
> > instead of struct clk APIs for clk providers in general. I'd accept a
> > patch that migrates the two calls to clk_register_fractional_divider()
> > with a call to clk_hw_register_fractional_divider() instead. If that's
> > done we can remove clk_register_fractional_divider(), which is the
> > overall plan but nobody got around to it so far.
> 
> Oh hmm, that doesn't look too hard for those two - although I'm not sure
> I have a way of testing it?

Sure. I don't think anything really changes if that's done so probably a
compile test is all that's needed.

> 
> However, my question was about the clk_hw_*un*register_fractional_divider
> - I can see the clk_register_fractional_divider can be replaced by
> clk_hw_register_fractional_divider - but would there need to be
> a call to the unregister somewhere? (Which is what my script noticed
> there's no callers of).
> 

Yes they would call clk_hw_unregister_fractional_divider() as well after
changing to use clk_hw pointers for the registration path.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-10-10  1:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-09  0:54 Of clk_hw_unregister_fractional_divider Dr. David Alan Gilbert
2024-10-09 20:29 ` Stephen Boyd
2024-10-10  0:58   ` Dr. David Alan Gilbert
2024-10-10  1:23     ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox