Fix a condition that generate watchdog timeout inside "lpc32xx_i2c_read" when parameters alen != 0 and len = 0.
Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
*(data++) = readl(&i2c->rx);
}
}
+ /* wait for end of transation */
+ while (!((stat = readl(&i2c->stat)) & LPC32XX_I2C_STAT_TDI))
+ ;
+ /* clear end-of-transaction flag */
+ writel(1, &i2c->stat);
}
- /* wait for end of transation */
- while (!((stat = readl(&i2c->stat)) & LPC32XX_I2C_STAT_TDI))
- ;
- /* clear end-of-transaction flag */
- writel(1, &i2c->stat);
/* success */
return 0;
}