9
0
Fork 0

commands: i2c: add message if write is not successful

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Silvio Fricke 2014-07-10 16:19:56 +02:00 committed by Sascha Hauer
parent 32a9bb7e9d
commit 21c5b4ff13
1 changed files with 5 additions and 1 deletions

View File

@ -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) {