public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c-eg20t : Fix the issue of Combined R/W transfer mode
@ 2011-06-23  7:17 Tomoya MORINAGA
       [not found] ` <1308813430-2697-1-git-send-email-tomoya-linux-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Tomoya MORINAGA @ 2011-06-23  7:17 UTC (permalink / raw)
  To: Jean Delvare, Ben Dooks, Wolfram Sang, Qi Wang, Linus Walleij
  Cc: yong.y.wang-ral2JQCrhuEAvxtiuMwx3w,
	joel.clark-ral2JQCrhuEAvxtiuMwx3w,
	kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w,
	toshiharu-linux-ECg8zkTtlr0C6LszWs/t0g, Tomoya MORINAGA

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-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
---
 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 b2f94dc..4bc272e 100644
--- a/drivers/i2c/busses/i2c-eg20t.c
+++ b/drivers/i2c/busses/i2c-eg20t.c
@@ -672,7 +672,7 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap,
 	/* transfer not completed */
 	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->flags |= adap->pch_buff_mode_en;
 		status = pmsg->flags;
@@ -698,7 +698,7 @@ static s32 pch_i2c_xfer(struct i2c_adapter *i2c_adap,
 
 	mutex_unlock(&pch_mutex);
 
-	return ret;
+	return (ret < 0) ? ret : num;
 }
 
 /**
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-07-12  0:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-23  7:17 [PATCH] i2c-eg20t : Fix the issue of Combined R/W transfer mode Tomoya MORINAGA
     [not found] ` <1308813430-2697-1-git-send-email-tomoya-linux-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
2011-06-23  7:52   ` Alexander Stein
     [not found]     ` <201106230952.09286.alexander.stein-93q1YBGzJSMe9JSWTWOYM3xStJ4P+DSV@public.gmane.org>
2011-06-23  8:46       ` Tomoya MORINAGA
     [not found]         ` <4E02FD74.8020503-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
2011-06-30  8:16           ` Christian Gmeiner
     [not found]             ` <BANLkTi=zDMnwX5xYFazM3qb17wa6yY4LZw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-30 14:08               ` Christian Gmeiner
     [not found]                 ` <BANLkTi=y43pWQC9wxjSPCEbr47hTYbJF6w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-01  6:19                   ` Tomoya MORINAGA
     [not found]                     ` <4E0D66E7.7070409-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
2011-07-05 11:37                       ` Christian Gmeiner
2011-07-11 10:36                         ` Christian Gmeiner
2011-07-12  0:58                           ` Tomoya MORINAGA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox