[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: [PATCH] i2c_tools.c: i2ctransfer
From: Nikolaus Voss <nv () vosn ! de>
Date: 2019-02-11 10:30:52
Message-ID: 20190211103052.D4BE04D00C () mail ! steuer-voss ! de
[Download RAW message or body]
Call i2c_set_slave_addr() unconditionally as busy checking
is skipped depending on force argument.
Clarify usage texts for -f and -a flags.
Signed-off-by: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>
---
miscutils/i2c_tools.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c
index 455ff028d..7a2e8534a 100644
--- a/miscutils/i2c_tools.c
+++ b/miscutils/i2c_tools.c
@@ -1406,8 +1406,8 @@ static void check_i2c_func(int fd)
//usage:#define i2ctransfer_full_usage "\n\n"
//usage: "Read/write I2C data in one transfer"
//usage: "\n"
-//usage: "\n -f Force access"
-//usage: "\n -a Force scanning of non-regular addresses"
+//usage: "\n -f Force access to busy addresses"
+//usage: "\n -a Force access to non-regular addresses"
//usage: "\n -y Disable interactive mode"
int i2ctransfer_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
int i2ctransfer_main(int argc UNUSED_PARAM, char **argv)
@@ -1467,9 +1467,7 @@ int i2ctransfer_main(int argc UNUSED_PARAM, char **argv)
len = xstrtou_range(arg_ptr, 0, 0, 0xffff);
if (end) {
bus_addr = xstrtou_range(end + 1, 0, first, last);
-//TODO: will this work correctly if -f is specified?
- if (!(opts & opt_f))
- i2c_set_slave_addr(fd, bus_addr, (opts & opt_f));
+ i2c_set_slave_addr(fd, bus_addr, (opts & opt_f));
} else {
/* Reuse last address if possible */
if (bus_addr < 0)
--
2.17.1
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic