diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-02-23 06:38:19 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2011-03-21 05:23:55 -0400 |
commit | 93c92cfdec8c3f8764894b37606c174f68fd9338 (patch) | |
tree | 131888459d95f1139685e8c5b3f8ac30c7215d47 /drivers/i2c | |
parent | c66dc529194be374556d166ee7ddb84a7d1d302b (diff) |
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: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-pxa.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index fa8dd2c634d9..86128363a57f 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -770,8 +770,10 @@ static int i2c_pxa_do_xfer(struct pxa_i2c *i2c, struct i2c_msg *msg, int num) | |||
770 | */ | 770 | */ |
771 | ret = i2c->msg_idx; | 771 | ret = i2c->msg_idx; |
772 | 772 | ||
773 | if (timeout == 0) | 773 | if (!timeout && i2c->msg_num) { |
774 | i2c_pxa_scream_blue_murder(i2c, "timeout"); | 774 | i2c_pxa_scream_blue_murder(i2c, "timeout"); |
775 | ret = I2C_RETRY; | ||
776 | } | ||
775 | 777 | ||
776 | out: | 778 | out: |
777 | return ret; | 779 | return ret; |