Re: [RFC,PATCH 1/3] Add a common struct clk

From: Jeremy Kerr
Date: Mon Feb 07 2011 - 03:23:18 EST


Hi Dima,

> > +int clk_prepare(struct clk *clk)
> > +{
> > + int ret = 0;
> > +
> > + if (!clk->ops->prepare)
> > + return 0;
> > +
> > + mutex_lock(&clk->prepare_lock);
> > + if (clk->prepare_count == 0)
> > + ret = clk->ops->prepare(clk);
> > +
> > + if (!ret)
> > + clk->prepare_count++;
> > + mutex_unlock(&clk->prepare_lock);
> > +
> > + return 0;
>
> return ret;

Good catch, thanks.


Jeremy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/