Skip to content

Commit

Permalink
i2c: sh_mobile: fix timeout error handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guennadi Liakhovetski authored and Wolfram Sang committed Feb 10, 2013
1 parent 05cf936 commit 5687265
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/i2c/busses/i2c-sh_mobile.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,11 @@ static int sh_mobile_i2c_xfer(struct i2c_adapter *adapter,
k = wait_event_timeout(pd->wait,
pd->sr & (ICSR_TACK | SW_DONE),
5 * HZ);
if (!k)
if (!k) {
dev_err(pd->dev, "Transfer request timed out\n");
err = -ETIMEDOUT;
break;
}

retry_count = 1000;
again:
Expand Down

0 comments on commit 5687265

Please sign in to comment.