From: Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
To: Jean Delvare <khali@linux-fr.org>,
Ben Dooks <ben-linux@fluff.org>,
Wolfram Sang <w.sang@pengutronix.de>, Qi Wang <qi.wang@intel.com>,
Linus Walleij <linus.walleij@stericsson.com>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: yong.y.wang@intel.com, joel.clark@intel.com,
kok.howg.ewe@intel.com, toshiharu-linux@dsn.okisemi.com,
Tomoya MORINAGA <tomoya-linux@dsn.okisemi.com>
Subject: [PATCH] i2c-eg20t : Fix the issue of Combined R/W transfer mode
Date: Thu, 23 Jun 2011 16:17:10 +0900 [thread overview]
Message-ID: <1308813430-2697-1-git-send-email-tomoya-linux@dsn.okisemi.com> (raw)
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>
---
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
next reply other threads:[~2011-06-23 7:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-23 7:17 Tomoya MORINAGA [this message]
2011-06-23 7:52 ` Alexander Stein
2011-06-23 8:46 ` Tomoya MORINAGA
2011-06-30 8:16 ` Christian Gmeiner
2011-06-30 14:08 ` Christian Gmeiner
2011-07-01 6:19 ` Tomoya MORINAGA
2011-07-05 11:37 ` Christian Gmeiner
2011-07-11 10:36 ` Christian Gmeiner
2011-07-12 0:58 ` Tomoya MORINAGA
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1308813430-2697-1-git-send-email-tomoya-linux@dsn.okisemi.com \
--to=tomoya-linux@dsn.okisemi.com \
--cc=ben-linux@fluff.org \
--cc=joel.clark@intel.com \
--cc=khali@linux-fr.org \
--cc=kok.howg.ewe@intel.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=qi.wang@intel.com \
--cc=toshiharu-linux@dsn.okisemi.com \
--cc=w.sang@pengutronix.de \
--cc=yong.y.wang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®