提交 5687265b 编写于 作者: G Guennadi Liakhovetski 提交者: Wolfram Sang

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: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: NWolfram Sang <wolfram@the-dreams.de>
上级 05cf9368
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册