mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Silvio Fricke <silvio.fricke@gmail.com>
To: barebox@lists.infradead.org
Cc: Silvio Fricke <silvio.fricke@gmail.com>
Subject: [PATCH 3/3] commands: i2c: add message if write is not successful
Date: Thu, 10 Jul 2014 16:19:56 +0200	[thread overview]
Message-ID: <11e164853111770873ab2c9837914ad8633fa1ba.1405001817.git.silvio.fricke@gmail.com> (raw)
In-Reply-To: <cover.1405000144.git.silvio.fricke@gmail.com>
In-Reply-To: <cover.1405000144.git.silvio.fricke@gmail.com>

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
---
 commands/i2c.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/commands/i2c.c b/commands/i2c.c
index e3d79b0..d6c5412 100644
--- a/commands/i2c.c
+++ b/commands/i2c.c
@@ -114,8 +114,12 @@ static int do_i2c_write(int argc, char *argv[])
 		*(buf + i) = (char) simple_strtol(argv[optind+i], NULL, 16);
 
 	ret = i2c_write_reg(&client, reg | wide, buf, count);
-	if (ret != count)
+	if (ret != count) {
+		if (verbose)
+			printf("write aborted, count(%i) != writestatus(%i)\n",
+				count, ret);
 		goto out;
+	}
 	ret = 0;
 
 	if (verbose) {
-- 
2.0.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2014-07-10 14:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10 14:19 [PATCH 0/3] some i2c patches Silvio Fricke
2014-07-10 14:19 ` [PATCH 1/3] commands: i2c: verbose option doesn't need argument Silvio Fricke
2014-07-10 14:19 ` [PATCH 2/3] commands: i2c: simplify i2c wide access logic Silvio Fricke
2014-07-10 14:19 ` Silvio Fricke [this message]
2014-07-11  5:41 ` [PATCH 0/3] some i2c patches 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=11e164853111770873ab2c9837914ad8633fa1ba.1405001817.git.silvio.fricke@gmail.com \
    --to=silvio.fricke@gmail.com \
    --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