Changeset 5884

Show
Ignore:
Timestamp:
11/25/10 23:07:53 (3 years ago)
Author:
khali
Message:

tools: Drop arbitrary limit on I2C bus number

Location:
i2c-tools/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • i2c-tools/trunk/CHANGES

    r5882 r5884  
    1717  eepromer: Fix array initialization overrun 
    1818  i2cdetect: Drop legacy reference to ISA bus 
     19             Drop arbitrary limit on I2C bus number 
     20  i2cdump: Drop arbitrary limit on I2C bus number 
     21  i2cget: Drop arbitrary limit on I2C bus number 
    1922  i2cset: Add support for short writes with PEC 
     23          Drop arbitrary limit on I2C bus number 
    2024  i2c-stub-from-dump: Use udev settle to speed up initialization 
    2125                      Unload i2c-stub automatically if needed 
  • i2c-tools/trunk/tools/i2cbusses.c

    r5854 r5884  
    333333int lookup_i2c_bus(const char *i2cbus_arg) 
    334334{ 
    335         long i2cbus; 
     335        unsigned long i2cbus; 
    336336        char *end; 
    337337 
    338         i2cbus = strtol(i2cbus_arg, &end, 0); 
     338        i2cbus = strtoul(i2cbus_arg, &end, 0); 
    339339        if (*end || !*i2cbus_arg) { 
    340340                /* Not a number, maybe a name? */ 
    341341                return lookup_i2c_bus_by_name(i2cbus_arg); 
    342342        } 
    343         if (i2cbus < 0 || i2cbus > 0xff) { 
    344                 fprintf(stderr, "Error: I2C bus out of range (0-255)!\n"); 
     343        if (i2cbus > INT_MAX) { 
     344                fprintf(stderr, "Error: I2C bus out of range!\n"); 
    345345                return -2; 
    346346        }