[RFC 1/3] SPI: imx: Convert to devm_* API

Shawn Guo shawn.guo at linaro.org
Thu May 30 00:06:11 EDT 2013


On Thu, May 30, 2013 at 07:50:38AM +0400, Alexander Shiyan wrote:
> > On Wed, May 29, 2013 at 09:10:28PM +0400, Alexander Shiyan wrote:
> > > Use devm_* functions for the driver.
> > > This ensures more consistent error values and simplifies error paths.
> > > 
> > > Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
> > > ---
> > >  drivers/spi/spi-imx.c | 79 ++++++++++++++-------------------------------------
> > >  1 file changed, 21 insertions(+), 58 deletions(-)
> > > 
> > > diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
> ...
> > >  	master->dev.of_node = pdev->dev.of_node;
> > >  	ret = spi_bitbang_start(&spi_imx->bitbang);
> > 
> > ---8<-----
> > > -	if (ret) {
> > > -		dev_err(&pdev->dev, "bitbang start failed with %d\n", ret);
> > > -		goto out_clk_put;
> > > -	}
> > > -
> > > -	dev_info(&pdev->dev, "probed\n");
> > > +	if (!ret)
> > > +		return 0;
> > >  
> > > -	return ret;
> > > +	dev_err(&pdev->dev, "bitbang start failed with %d\n", ret);
> > >  
> > > -out_clk_put:
> > --->8------
> > 
> > I do not understand why above changes are necessary.
> 
> This just simplifies the error path and removes one "goto".
> 
Sorry, I do not get it and take this as a diff stat churn.

Shawn




More information about the linux-arm-kernel mailing list