diff mbox

[U-Boot,6/7] i2c: lpc32xx: fix write timeout

Message ID 1438018660-19858-7-git-send-email-slemieux.tyco@gmail.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Sylvain Lemieux July 27, 2015, 5:37 p.m. UTC
From: Sylvain Lemieux <slemieux@tycoint.com>

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>
---
 drivers/i2c/lpc32xx_i2c.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Tom Rini Aug. 13, 2015, 1:20 p.m. UTC | #1
On Mon, Jul 27, 2015 at 01:37:39PM -0400, slemieux.tyco@gmail.com wrote:

> From: Sylvain Lemieux <slemieux@tycoint.com>
> 
> 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>

Applied to u-boot/master, thanks!
diff mbox

Patch

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 */