5 Nov
2012
5 Nov
'12
10:03 a.m.
On Sun, Nov 04, 2012 at 05:05:34PM -0800, Kuninori Morimoto wrote:
- own = clk_get(dev, NULL);
- if (IS_ERR(own))
return -EINVAL;
Any reason not to use devm_clk_get()?
Ahh yes, Sorry. BTW, currect code calls this function many times now, (this clk is local variable now) then should I use...
- use devm_clk_get() / devm_clk_put() pair
- use clk_get() / clk_put() pair
- keep these clocks under private date (struct fsi_prive) and use devm_clk_get() only _probe timing.
Option 3 is the normal approach here.
- if (enable) {
clk_disable(ick);
Are we sure that calls to this function are always balanced so that calls to clk_enable() and clk_disable() are balanced?
I balanced it by local technic. But I can say it is un-understandable. Can I use counter ?
Well, the whole thing is that the clk_enable() will count too so if you don't make sure the calls are balanced you'll run into issues. I'd add some comments which explain why this is safe.