[PATCH 1/8] soc: imx: gpc: fix gpc clk get error handling

Shawn Guo shawnguo at kernel.org
Tue Mar 21 23:38:25 PDT 2017


On Thu, Mar 23, 2017 at 02:33:06AM +0800, Dong Aisheng wrote:
> On Mon, Mar 20, 2017 at 04:05:24PM +0800, Shawn Guo wrote:
> > On Mon, Mar 20, 2017 at 02:15:40PM +0800, Dong Aisheng wrote:
> > > diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
> > > index 1e9b3b8..c9bfdfd 100644
> > > --- a/drivers/soc/imx/gpc.c
> > > +++ b/drivers/soc/imx/gpc.c
> > > @@ -143,7 +143,7 @@ static int imx_pgc_get_clocks(struct device *dev, struct imx_pm_domain *domain)
> > >  	return 0;
> > >  
> > >  clk_err:
> > > -	for (; i >= 0; i--)
> > > +	while (i--)
> > >  		clk_put(domain->clk[i]);
> > 
> > Will clk[0] be put then?
> > 
> 
> Yes, it is a bit tricky:
> See as follows:
> while (i--)	<== (i = 1)
> 	clk_put(domain->clk[i]);	<=== (i = 0)

Hah, I was still thinking it in the way how for-loop works.  Sorry for
the noise.

Shawn



More information about the linux-arm-kernel mailing list