diff options
author | Bartosz Golaszewski <bartekgola@gmail.com> | 2015-06-05 10:27:29 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-06-07 18:05:46 +0200 |
commit | e545bf6723ebfd486c6dce6b754b6de792c46de1 (patch) | |
tree | edcbed2fc8fe38eb04507b628304ac870ac2b2d6 /miscutils | |
parent | 314742747deecd454ae58dfd68be453115ba226c (diff) | |
download | busybox-w32-e545bf6723ebfd486c6dce6b754b6de792c46de1.tar.gz busybox-w32-e545bf6723ebfd486c6dce6b754b6de792c46de1.tar.bz2 busybox-w32-e545bf6723ebfd486c6dce6b754b6de792c46de1.zip |
i2cdetect: don't scan non-regular addresses without the '-a' option
Addresses 0x00-0x02 shouldn't be scanned by default. This patch makes
'first' default to 0x03 and only enables lower addresses if '-a' option
is passed
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
-rw-r--r-- | miscutils/i2c_tools.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/miscutils/i2c_tools.c b/miscutils/i2c_tools.c index d5127ec27..6f9787280 100644 --- a/miscutils/i2c_tools.c +++ b/miscutils/i2c_tools.c | |||
@@ -1282,7 +1282,7 @@ int i2cdetect_main(int argc UNUSED_PARAM, char **argv) | |||
1282 | const char *const optstr = "yaqrFl"; | 1282 | const char *const optstr = "yaqrFl"; |
1283 | 1283 | ||
1284 | int fd, bus_num, i, j, mode = DETECT_MODE_AUTO, status; | 1284 | int fd, bus_num, i, j, mode = DETECT_MODE_AUTO, status; |
1285 | unsigned first = 0x00, last = 0x77, opts; | 1285 | unsigned first = 0x03, last = 0x77, opts; |
1286 | unsigned long funcs; | 1286 | unsigned long funcs; |
1287 | 1287 | ||
1288 | opt_complementary = "q--r:r--q:" /* mutually exclusive */ | 1288 | opt_complementary = "q--r:r--q:" /* mutually exclusive */ |
@@ -1316,8 +1316,10 @@ int i2cdetect_main(int argc UNUSED_PARAM, char **argv) | |||
1316 | else if (opts & opt_q) | 1316 | else if (opts & opt_q) |
1317 | mode = DETECT_MODE_QUICK; | 1317 | mode = DETECT_MODE_QUICK; |
1318 | 1318 | ||
1319 | if (opts & opt_a) | 1319 | if (opts & opt_a) { |
1320 | first = 0x00; | ||
1320 | last = 0x7f; | 1321 | last = 0x7f; |
1322 | } | ||
1321 | 1323 | ||
1322 | /* Read address range. */ | 1324 | /* Read address range. */ |
1323 | if (argv[1]) { | 1325 | if (argv[1]) { |