[PATCH 2/2] commands: spi: do not restrict spi's data to be hex-formatted

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

 



The price to pay is needing the usual prefix "0x" for each hex-formatted number.

Signed-off-by: Ulrich Ölmann <u.oelmann@xxxxxxxxxxxxxx>
---
 commands/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/spi.c b/commands/spi.c
index 6603b34b673c..7bf193b0bbbb 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)
-- 
2.11.0


_______________________________________________
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