mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH v2 4/5] ratp: i2c: Do not return error
Date: Thu,  8 Sep 2022 11:30:04 +0200	[thread overview]
Message-ID: <20220908093005.3035259-5-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20220908093005.3035259-1-s.hauer@pengutronix.de>

The RATP command implementations should only return an error on internal
failures. When an i2c command failed we should return 0 though to
actually send the error message. Without it the remote would just wait
for a response until it times out.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/ratp/i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/ratp/i2c.c b/common/ratp/i2c.c
index c14bbbf9b9..404ddd2ece 100644
--- a/common/ratp/i2c.c
+++ b/common/ratp/i2c.c
@@ -162,7 +162,7 @@ out:
 	*rsp = (struct ratp_bb *)i2c_read_rsp;
 	*rsp_len = i2c_read_rsp_len;
 
-	return ret;
+	return 0;
 }
 
 BAREBOX_RATP_CMD_START(I2C_READ)
@@ -271,7 +271,7 @@ out:
 	*rsp = (struct ratp_bb *)i2c_write_rsp;
 	*rsp_len = sizeof(*i2c_write_rsp);
 
-	return ret;
+	return 0;
 }
 
 BAREBOX_RATP_CMD_START(I2C_WRITE)
-- 
2.30.2




  parent reply	other threads:[~2022-09-08  9:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08  9:30 [PATCH v2 0/5] bbremote: Convert to python3 Sascha Hauer
2022-09-08  9:30 ` [PATCH v2 1/5] remove local pyserial Sascha Hauer
2022-09-08  9:30 ` [PATCH v2 2/5] bbremote: Convert to python3 Sascha Hauer
2022-09-08  9:30 ` [PATCH v2 3/5] ratp: getenv: Do not crash on non-existing variables Sascha Hauer
2022-09-08  9:30 ` Sascha Hauer [this message]
2022-09-08  9:30 ` [PATCH v2 5/5] bbremote: Print usage when no command is given Sascha Hauer

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=20220908093005.3035259-5-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@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