linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: b.galvani@gmail.com (Beniamino Galvani)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 3/4] i2c: meson: fix return codes on error
Date: Sun, 26 Nov 2017 17:40:56 +0100	[thread overview]
Message-ID: <20171126164057.27728-4-b.galvani@gmail.com> (raw)
In-Reply-To: <20171126164057.27728-1-b.galvani@gmail.com>

Change meson_i2c_xfer_msg() to return -EREMOTEIO in case of NACK, as
done by other drivers. Also, don't change the return error in
meson_i2c_xfer().

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
---
 drivers/i2c/meson_i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/meson_i2c.c b/drivers/i2c/meson_i2c.c
index 84e1997c76..2f39214ad2 100644
--- a/drivers/i2c/meson_i2c.c
+++ b/drivers/i2c/meson_i2c.c
@@ -178,7 +178,7 @@ static int meson_i2c_xfer_msg(struct meson_i2c *i2c, struct i2c_msg *msg,
 
 		if (readl(&i2c->regs->ctrl) & REG_CTRL_ERROR) {
 			debug("meson i2c: error\n");
-			return -ENXIO;
+			return -EREMOTEIO;
 		}
 
 		if ((msg->flags & I2C_M_RD) && i2c->count) {
@@ -200,7 +200,7 @@ static int meson_i2c_xfer(struct udevice *bus, struct i2c_msg *msg,
 	for (i = 0; i < nmsgs; i++) {
 		ret = meson_i2c_xfer_msg(i2c, msg + i, i == nmsgs - 1);
 		if (ret)
-			return -EREMOTEIO;
+			return ret;
 	}
 
 	return 0;
-- 
2.14.3

  parent reply	other threads:[~2017-11-26 16:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-26 16:40 [PATCH 0/4] meson i2c driver cleanups Beniamino Galvani
2017-11-26 16:40 ` [PATCH 1/4] i2c: meson: improve Kconfig description Beniamino Galvani
2017-11-27 17:09   ` Simon Glass
2017-12-07  8:24   ` Heiko Schocher
2017-12-07 12:19   ` Heiko Schocher
2017-11-26 16:40 ` [PATCH 2/4] i2c: meson: reduce timeout Beniamino Galvani
2017-11-27 17:09   ` Simon Glass
2017-12-07  8:24   ` Heiko Schocher
2017-12-07 12:19   ` Heiko Schocher
2017-11-26 16:40 ` Beniamino Galvani [this message]
2017-11-27 17:09   ` [PATCH 3/4] i2c: meson: fix return codes on error Simon Glass
2017-12-07  8:25   ` Heiko Schocher
2017-12-07 12:20   ` Heiko Schocher
2017-11-26 16:40 ` [PATCH 4/4] i2c: meson: add some comments Beniamino Galvani
2017-11-27 17:10   ` Simon Glass
2017-12-07  8:25   ` Heiko Schocher
2017-12-07 12:20   ` Heiko Schocher

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=20171126164057.27728-4-b.galvani@gmail.com \
    --to=b.galvani@gmail.com \
    --cc=linus-amlogic@lists.infradead.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 NNTP newsgroup(s).