summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorUlrich Ölmann <u.oelmann@pengutronix.de>2017-10-19 08:53:07 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-10-23 09:27:16 +0200
commit9d70373527195dcfea48274bf0fec5a40744d615 (patch)
tree5a7dc4407b41743096b9e17b97de20ab8c1eaedc /commands
parented5d71ab06bf45e585f9d03049f4730109979aff (diff)
downloadbarebox-9d70373527195dcfea48274bf0fec5a40744d615.tar.gz
barebox-9d70373527195dcfea48274bf0fec5a40744d615.tar.xz
commands: i2c: do not restrict i2c_write's data to be hex-formatted
Change the default base to 0 to be consistent with the "mw" command and particularly allow decimally formatted data. The price to pay is needing the usual prefix "0x" for each hex-formatted number. Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r--commands/i2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/i2c.c b/commands/i2c.c
index 573032ab15..b74c53509f 100644
--- a/commands/i2c.c
+++ b/commands/i2c.c
@@ -129,7 +129,7 @@ static int do_i2c_write(int argc, char *argv[])
buf = xmalloc(count);
for (i = 0; i < count; i++)
- *(buf + i) = (char) simple_strtol(argv[optind+i], NULL, 16);
+ *(buf + i) = (char) simple_strtol(argv[optind+i], NULL, 0);
ret = i2c_write_reg(&client, reg | wide, buf, count);
if (ret != count) {