mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-16 17:23:55 +08:00
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>
This commit is contained in:
parent
05cf936846
commit
5687265b31
@ -521,8 +521,11 @@ static int sh_mobile_i2c_xfer(struct i2c_adapter *adapter,
|
|||||||
k = wait_event_timeout(pd->wait,
|
k = wait_event_timeout(pd->wait,
|
||||||
pd->sr & (ICSR_TACK | SW_DONE),
|
pd->sr & (ICSR_TACK | SW_DONE),
|
||||||
5 * HZ);
|
5 * HZ);
|
||||||
if (!k)
|
if (!k) {
|
||||||
dev_err(pd->dev, "Transfer request timed out\n");
|
dev_err(pd->dev, "Transfer request timed out\n");
|
||||||
|
err = -ETIMEDOUT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
retry_count = 1000;
|
retry_count = 1000;
|
||||||
again:
|
again:
|
||||||
|
Loading…
Reference in New Issue
Block a user