Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 93c92cfd authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Ben Dooks
Browse files

i2c-pxa2xx: check timeout correctly



timeout here maybe 0 if the event occured and a task with a higher
priority stole the cpu and we were sleeping longer than the timeout
value we specified.
In case of a real timeout I changed the error code to I2C_RETRY so we
retry the transfer.

Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarDirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent c66dc529
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -770,8 +770,10 @@ static int i2c_pxa_do_xfer(struct pxa_i2c *i2c, struct i2c_msg *msg, int num)
	 */
	ret = i2c->msg_idx;

	if (timeout == 0)
	if (!timeout && i2c->msg_num) {
		i2c_pxa_scream_blue_murder(i2c, "timeout");
		ret = I2C_RETRY;
	}

 out:
	return ret;