diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2013-01-17 04:45:55 -0500 |
---|---|---|
committer | Wolfram Sang <wolfram@the-dreams.de> | 2013-02-10 13:55:23 -0500 |
commit | 5687265b3127024089dc0b25956772405b9f53d3 (patch) | |
tree | 1b88a79fedd263c782dbccb6a1fcc52691465088 /drivers/i2c | |
parent | 05cf936846ca6aef1b34ba26054728fdbc154558 (diff) |
i2c: sh_mobile: fix timeout error handling
In a timeout case return an error immediately from the driver's
.master_xfer() method, instead of continuing and letting higher layers
fail.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Wolfram Sang <wolfram@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-sh_mobile.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index 34024f3a19f5..daaf0ebe8177 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c | |||
@@ -521,8 +521,11 @@ static int sh_mobile_i2c_xfer(struct i2c_adapter *adapter, | |||
521 | k = wait_event_timeout(pd->wait, | 521 | k = wait_event_timeout(pd->wait, |
522 | pd->sr & (ICSR_TACK | SW_DONE), | 522 | pd->sr & (ICSR_TACK | SW_DONE), |
523 | 5 * HZ); | 523 | 5 * HZ); |
524 | if (!k) | 524 | if (!k) { |
525 | dev_err(pd->dev, "Transfer request timed out\n"); | 525 | dev_err(pd->dev, "Transfer request timed out\n"); |
526 | err = -ETIMEDOUT; | ||
527 | break; | ||
528 | } | ||
526 | 529 | ||
527 | retry_count = 1000; | 530 | retry_count = 1000; |
528 | again: | 531 | again: |