Show
Ignore:
Timestamp:
05/05/08 16:54:18 (4 years ago)
Author:
khali
Message:

No need to print the i2c bus number in functionality error message.

Files:
1 modified

Legend:

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

    r5237 r5240  
    4646} 
    4747 
    48 static int check_funcs(int file, int i2cbus, int size, int pec) 
     48static int check_funcs(int file, int size, int pec) 
    4949{ 
    5050        unsigned long funcs; 
     
    6060        case I2C_SMBUS_BYTE: 
    6161                if (!(funcs & I2C_FUNC_SMBUS_WRITE_BYTE)) { 
    62                         fprintf(stderr, "Error: Adapter for i2c bus %d does " 
    63                                 "not have byte send capability\n", i2cbus); 
     62                        fprintf(stderr, "Error: Adapter does " 
     63                                "not have byte send capability\n"); 
    6464                        return -1; 
    6565                } 
     
    6868        case I2C_SMBUS_BYTE_DATA: 
    6969                if (!(funcs & I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) { 
    70                         fprintf(stderr, "Error: Adapter for i2c bus %d does " 
    71                                 "not have byte write capability\n", i2cbus); 
     70                        fprintf(stderr, "Error: Adapter does " 
     71                                "not have byte write capability\n"); 
    7272                        return -1; 
    7373                } 
     
    7676        case I2C_SMBUS_WORD_DATA: 
    7777                if (!(funcs & I2C_FUNC_SMBUS_WRITE_WORD_DATA)) { 
    78                         fprintf(stderr, "Error: Adapter for i2c bus %d does " 
    79                                 "not have word write capability\n", i2cbus); 
     78                        fprintf(stderr, "Error: Adapter does " 
     79                                "not have word write capability\n"); 
    8080                        return -1; 
    8181                } 
     
    8585        if (pec 
    8686         && !(funcs & (I2C_FUNC_SMBUS_PEC | I2C_FUNC_I2C))) { 
    87                 fprintf(stderr, "Warning: Adapter for i2c bus %d does " 
    88                         "not seem to support PEC\n", i2cbus); 
     87                fprintf(stderr, "Warning: Adapter does " 
     88                        "not seem to support PEC\n"); 
    8989        } 
    9090 
     
    215215        file = open_i2c_dev(i2cbus, filename, 0); 
    216216        if (file < 0 
    217          || check_funcs(file, i2cbus, size, pec) 
     217         || check_funcs(file, size, pec) 
    218218         || set_slave_addr(file, address, force)) 
    219219                exit(1);