[PATCH 1/2] commands: i2c: do not restrict i2c_write'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/i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/i2c.c b/commands/i2c.c
index 573032ab1588..b74c53509f38 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) {
-- 
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