Show
Ignore:
Timestamp:
04/20/08 19:27:34 (4 years ago)
Author:
khali
Message:

Refactor the handling of the I2CBUS parameter. This ensures more
consistency accross the i2c tools.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • i2c-tools/trunk/tools/i2cget.c

    r5164 r5193  
    188188                help(); 
    189189 
    190         i2cbus = strtol(argv[flags+1], &end, 0); 
    191         if (*end || i2cbus < 0 || i2cbus > 0x3f) { 
    192                 fprintf(stderr, "Error: I2CBUS argument invalid!\n"); 
     190        i2cbus = lookup_i2c_bus(argv[flags+1]); 
     191        if (i2cbus < 0) 
    193192                help(); 
    194         } 
    195193 
    196194        address = strtol(argv[flags+2], &end, 0);