[PATCH 3/3] commands: i2c: add message if write is not successful

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Silvio Fricke <silvio.fricke@xxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox




[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux