提交 07e729ce 编写于 作者: T Tomoya MORINAGA 提交者: Ben Dooks

i2c-eg20t : Fix the issue of Combined R/W transfer mode

issue-1
In case combined transfer mode fails halfway, the processing must be stopped halfway.
However currently, the processing is continued.
This patch breaks the processing.

issue-2
Currently, pch_i2c_xfer returns read/write size at that time.
However pch_i2c_xfer must return the number of messages to be read/written.
This patch modifies correctly.
Signed-off-by: NTomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: NBen Dooks <ben-linux@fluff.org>
上级 7a9c42cc
...@@ -673,7 +673,7 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap, ...@@ -673,7 +673,7 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap,
/* transfer not completed */ /* transfer not completed */
adap->pch_i2c_xfer_in_progress = true; adap->pch_i2c_xfer_in_progress = true;
for (i = 0; i < num; i++) { for (i = 0; i < num && ret >= 0; i++) {
pmsg = &msgs[i]; pmsg = &msgs[i];
pmsg->flags |= adap->pch_buff_mode_en; pmsg->flags |= adap->pch_buff_mode_en;
status = pmsg->flags; status = pmsg->flags;
...@@ -699,7 +699,7 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap, ...@@ -699,7 +699,7 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap,
mutex_unlock(&pch_mutex); mutex_unlock(&pch_mutex);
return ret; return (ret < 0) ? ret : num;
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册