From 58243001a9419d9d1671e32611b7d15f6ed64b3a Mon Sep 17 00:00:00 2001 From: Sylvain Lemieux Date: Mon, 27 Jul 2015 13:37:39 -0400 Subject: [PATCH] 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 --- drivers/i2c/lpc32xx_i2c.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/lpc32xx_i2c.c b/drivers/i2c/lpc32xx_i2c.c index 4c66769103..7f4eccdf53 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 */ -- 2.30.2