diff options
author | Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com> | 2011-06-23 03:17:10 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2011-07-26 19:02:28 -0400 |
commit | 07e729ce894487e92405d3b221cffe587420a376 (patch) | |
tree | 2c92e54c46db89480b48a3e43c12f5f205bc2cc0 /drivers/i2c/busses/i2c-eg20t.c | |
parent | 7a9c42ccc9fd4317383e55209f825f974e64aa99 (diff) |
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: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-eg20t.c')
-rw-r--r-- | drivers/i2c/busses/i2c-eg20t.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c index 9b072fd42108..ce1a32b71e47 100644 --- a/drivers/i2c/busses/i2c-eg20t.c +++ b/drivers/i2c/busses/i2c-eg20t.c | |||
@@ -673,7 +673,7 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap, | |||
673 | /* transfer not completed */ | 673 | /* transfer not completed */ |
674 | adap->pch_i2c_xfer_in_progress = true; | 674 | adap->pch_i2c_xfer_in_progress = true; |
675 | 675 | ||
676 | for (i = 0; i < num; i++) { | 676 | for (i = 0; i < num && ret >= 0; i++) { |
677 | pmsg = &msgs[i]; | 677 | pmsg = &msgs[i]; |
678 | pmsg->flags |= adap->pch_buff_mode_en; | 678 | pmsg->flags |= adap->pch_buff_mode_en; |
679 | status = pmsg->flags; | 679 | status = pmsg->flags; |
@@ -699,7 +699,7 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap, | |||
699 | 699 | ||
700 | mutex_unlock(&pch_mutex); | 700 | mutex_unlock(&pch_mutex); |
701 | 701 | ||
702 | return ret; | 702 | return (ret < 0) ? ret : num; |
703 | } | 703 | } |
704 | 704 | ||
705 | /** | 705 | /** |