Browse Source

tools: Drop arbitrary limit on I2C bus number

git-svn-id: http://lm-sensors.org/svn/i2c-tools/trunk@5884 7894878c-1315-0410-8ee3-d5d059ff63e0
tags/v3.0.3
Jean Delvare 15 years ago
parent
commit
54a2dcbba5
  1. 4
      CHANGES
  2. 8
      tools/i2cbusses.c

4
CHANGES

@ -16,7 +16,11 @@ SVN
decode-xeon: Delete decode-xeon: Delete
eepromer: Fix array initialization overrun eepromer: Fix array initialization overrun
i2cdetect: Drop legacy reference to ISA bus i2cdetect: Drop legacy reference to ISA bus
Drop arbitrary limit on I2C bus number
i2cdump: Drop arbitrary limit on I2C bus number
i2cget: Drop arbitrary limit on I2C bus number
i2cset: Add support for short writes with PEC i2cset: Add support for short writes with PEC
Drop arbitrary limit on I2C bus number
i2c-stub-from-dump: Use udev settle to speed up initialization i2c-stub-from-dump: Use udev settle to speed up initialization
Unload i2c-stub automatically if needed Unload i2c-stub automatically if needed
Add support for multiple dumps Add support for multiple dumps

8
tools/i2cbusses.c

@ -332,16 +332,16 @@ done:
*/ */
int lookup_i2c_bus(const char *i2cbus_arg) int lookup_i2c_bus(const char *i2cbus_arg)
{ {
long i2cbus;
unsigned long i2cbus;
char *end; char *end;
i2cbus = strtol(i2cbus_arg, &end, 0);
i2cbus = strtoul(i2cbus_arg, &end, 0);
if (*end || !*i2cbus_arg) { if (*end || !*i2cbus_arg) {
/* Not a number, maybe a name? */ /* Not a number, maybe a name? */
return lookup_i2c_bus_by_name(i2cbus_arg); return lookup_i2c_bus_by_name(i2cbus_arg);
} }
if (i2cbus < 0 || i2cbus > 0xff) {
fprintf(stderr, "Error: I2C bus out of range (0-255)!\n");
if (i2cbus > INT_MAX) {
fprintf(stderr, "Error: I2C bus out of range!\n");
return -2; return -2;
} }

Loading…
Cancel
Save