diff options
author | Sylvain Lemieux <slemieux@tycoint.com> | 2015-07-27 17:37:39 (GMT) |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2015-08-17 12:11:50 (GMT) |
commit | 58243001a9419d9d1671e32611b7d15f6ed64b3a (patch) | |
tree | 6e9a0c341db8d940bcf5da4fdc195e85a950930c /drivers/i2c/lpc32xx_i2c.c | |
parent | 3d2b6a2e5f57f752c2541116beb89bf6db41a841 (diff) | |
download | u-boot-fsl-qoriq-58243001a9419d9d1671e32611b7d15f6ed64b3a.tar.xz |
i2c: lpc32xx: fix write timeout
Fix a condition that generate watchdog timeout inside "lpc32xx_i2c_write" when parameters alen = 0 and len = 0.
Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
Diffstat (limited to 'drivers/i2c/lpc32xx_i2c.c')
-rw-r--r-- | drivers/i2c/lpc32xx_i2c.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/i2c/lpc32xx_i2c.c b/drivers/i2c/lpc32xx_i2c.c index 4c66769..7f4eccd 100644 --- a/drivers/i2c/lpc32xx_i2c.c +++ b/drivers/i2c/lpc32xx_i2c.c @@ -200,6 +200,8 @@ static int lpc32xx_i2c_write(struct i2c_adapter *adap, u8 dev, uint addr, if (alen | length) /* Address slave in write mode */ writel((dev<<1) | LPC32XX_I2C_TX_START, &i2c->tx); + else + return 0; /* write address bytes */ while (alen) { /* wait for transmit fifo not full */ |