From 21c5b4ff131d6c7703411f710814991288d1f1ea Mon Sep 17 00:00:00 2001 From: Silvio Fricke Date: Thu, 10 Jul 2014 16:19:56 +0200 Subject: [PATCH] commands: i2c: add message if write is not successful Signed-off-by: Silvio Fricke Signed-off-by: Sascha Hauer --- commands/i2c.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/i2c.c b/commands/i2c.c index e3d79b0ec..d6c541276 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) {