Linux-i2c Archive mirror
 help / color / mirror / Atom feed
From: Hans Hu <hanshu-oc@zhaoxin.com>
To: <andi.shyti@kernel.org>, <linux-i2c@vger.kernel.org>, <wsa@kernel.org>
Cc: <hanshu@zhaoxin.com>
Subject: [PATCH 2/2] i2c: viai2c: Fix bug for msg->len is 0
Date: Mon, 11 Mar 2024 11:26:00 +0800	[thread overview]
Message-ID: <20240311032600.56244-2-hanshu-oc@zhaoxin.com> (raw)
In-Reply-To: <20240311032600.56244-1-hanshu-oc@zhaoxin.com>

This is a bug that was accidentally introduced when
adjusting the wmt driver. Now fix it

Signed-off-by: Hans Hu <hanshu-oc@zhaoxin.com>
---
 drivers/i2c/busses/i2c-viai2c-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-viai2c-common.c b/drivers/i2c/busses/i2c-viai2c-common.c
index 4c208b3a509e..894d24c6b4d3 100644
--- a/drivers/i2c/busses/i2c-viai2c-common.c
+++ b/drivers/i2c/busses/i2c-viai2c-common.c
@@ -145,7 +145,7 @@ static int viai2c_irq_xfer(struct viai2c *i2c)
 		if (msg->len == 0) {
 			val = VIAI2C_CR_TX_END | VIAI2C_CR_CPU_RDY | VIAI2C_CR_ENABLE;
 			writew(val, base + VIAI2C_REG_CR);
-			return 0;
+			return 1;
 		}
 
 		if ((i2c->xfered_len + 1) == msg->len) {
-- 
2.34.1


  reply	other threads:[~2024-03-11  3:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-11  3:25 [PATCH 1/2] i2c: viai2c: Fix some minor style issues Hans Hu
2024-03-11  3:26 ` Hans Hu [this message]
2024-03-11  4:46   ` [PATCH 2/2] i2c: viai2c: Fix bug for msg->len is 0 Mukesh Kumar Savaliya
2024-03-11  6:11     ` Hans Hu
2024-03-11  6:46       ` Mukesh Kumar Savaliya
2024-03-11  7:27         ` Hans Hu

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=20240311032600.56244-2-hanshu-oc@zhaoxin.com \
    --to=hanshu-oc@zhaoxin.com \
    --cc=andi.shyti@kernel.org \
    --cc=hanshu@zhaoxin.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=wsa@kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).