From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Kerr Date: Mon, 07 Feb 2011 08:22:55 +0000 Subject: Re: [RFC,PATCH 1/3] Add a common struct clk Message-Id: <201102071622.56163.jeremy.kerr@canonical.com> List-Id: References: <201102011711.31258.jeremy.kerr@canonical.com> <1297058877.800158.458894385837.1.gpush@pororo> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-arm-kernel@lists.infradead.org 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