summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorUlrich Ölmann <u.oelmann@pengutronix.de>2017-10-19 08:53:08 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-10-23 09:27:16 +0200
commit23b64199bc39b68e978ddc5e09274ea11c49d0e1 (patch)
treeea5d8ab414531be64e6451ee16a833f38a0a82dd /commands
parent9d70373527195dcfea48274bf0fec5a40744d615 (diff)
downloadbarebox-23b64199bc39b68e978ddc5e09274ea11c49d0e1.tar.gz
barebox-23b64199bc39b68e978ddc5e09274ea11c49d0e1.tar.xz
commands: spi: do not restrict spi'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/spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/spi.c b/commands/spi.c
index 6603b34b67..7bf193b0bb 100644
--- a/commands/spi.c
+++ b/commands/spi.c
@@ -84,7 +84,7 @@ static int do_spi(int argc, char *argv[])
rx_buf = xmalloc(read);
for (i = 0; i < count; i++)
- tx_buf[i] = (u8) simple_strtol(argv[optind + i], NULL, 16);
+ tx_buf[i] = (u8) simple_strtol(argv[optind + i], NULL, 0);
ret = spi_write_then_read(&spi, tx_buf, count, rx_buf, read);
if (ret)