Re: [PATCH 5/6] i2c: omap: wait for transfer completion before sending STP bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HI,

On Wed, Jan 23, 2013 at 10:10:31PM +0200, Aaro Koskinen wrote:
> Hi,
> 
> Some minor comments/questions:
> 
> On Wed, Jan 23, 2013 at 12:23:07PM +0200, Felipe Balbi wrote:
> > @@ -639,31 +630,37 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
> >  		dev_err(dev->dev, "controller timed out\n");
> >  		omap_i2c_reset(dev);
> >  		__omap_i2c_init(dev);
> > -		return -ETIMEDOUT;
> > +		ret = -ETIMEDOUT;
> > +		goto out;
> >  	}
> >  
> > -	if (likely(!dev->cmd_err))
> > -		return 0;
> > -
> >  	/* We have an error */
> >  	if (dev->cmd_err & (OMAP_I2C_STAT_AL | OMAP_I2C_STAT_ROVR |
> >  			    OMAP_I2C_STAT_XUDF)) {
> >  		omap_i2c_reset(dev);
> >  		__omap_i2c_init(dev);
> > -		return -EIO;
> > +		ret = -EIO;
> > +		goto out;
> 
> Why change return to goto on these paths? If you reset and re-initialize
> the controller, I think it's unlikely that omap_i2c_wait_for_ardy()
> will ever succeed?

good catch, I'll update.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux