summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiquel Raynal <raynal.miquel@gmail.com>2016-04-13 23:24:34 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-04-15 07:32:52 +0200
commit24a6b3f8eabf08b589a2860aee9b670fa88cd085 (patch)
treeba2b275ab323ee2d4a842c97981b7119648d72d7
parent1bef2e8e8d30c5d6a39bcdbde5fb409c68df9f67 (diff)
downloadbarebox-24a6b3f8eabf08b589a2860aee9b670fa88cd085.tar.gz
i2c_probe: fix wrong start and stop addresses
This patch fixes the wrong range of i2c addresses used by the i2c_probe command when a stop address is provided. In this case the start address (startaddr) was taking the value of the stop address and the stop address (stopaddr) was always set to its default value. Signed-off-by: Miquel Raynal <raynal.miquel@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--commands/i2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/i2c.c b/commands/i2c.c
index f4ffc99..e6750e3 100644
--- a/commands/i2c.c
+++ b/commands/i2c.c
@@ -55,7 +55,7 @@ static int do_i2c_probe(int argc, char *argv[])
if (argc > 2)
startaddr = simple_strtol(argv[2], NULL, 0);
if (argc > 3)
- startaddr = simple_strtol(argv[3], NULL, 0);
+ stopaddr = simple_strtol(argv[3], NULL, 0);
if (startaddr > stopaddr)