Re: [PATCH V4 1/6] clk: OMAP: introduce device tree binding tokernel clock data

From: Nishanth Menon
Date: Sun Apr 14 2013 - 17:19:53 EST


On 10:22-20130413, Tony Lindgren wrote:
> * Nishanth Menon <nm@xxxxxx> [130412 16:43]:
> > Thanks for checking up. Fixed all of them below, will post part of
> > series again, only if I need to address further comments in other
> > patches..
>
> Thanks it seems that the other ones are ready to go, just one
> more comment below.
>
[...]
> > +static struct clk *omap_clk_src_get(struct of_phandle_args *clkspec, void *data)
> > +{
> > + struct clk *clk;
> > + char clk_name[32];
> > + struct device_node *np = clkspec->np;
> > +
> > + snprintf(clk_name, 32, "%s_ck", np->name);
> > + clk = clk_get(NULL, clk_name);
> > + if (IS_ERR(clk)) {
> > + pr_err("%s: could not get clock %s(%ld)\n", __func__,
> > + clk_name, PTR_ERR(clk));
> > + goto out;
> > + }
> > + clk_put(clk);
>
> It seems that clk_put() is actually wrong here. That's because
> of_clk_get() should boild down to just the look up of the clock
> and then clk_get() on it, so no double clk_get() is done in this
> case. Once the consumer driver is done, it will just call clk_put()
> on it.
Yep - updated version below.