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/i2cdump.c

    r5239 r5240  
    4747} 
    4848 
    49 static int check_funcs(int file, int i2cbus, int size, int pec) 
     49static int check_funcs(int file, int size, int pec) 
    5050{ 
    5151        unsigned long funcs; 
     
    6161        case I2C_SMBUS_BYTE: 
    6262                if (!((funcs & I2C_FUNC_SMBUS_BYTE) == I2C_FUNC_SMBUS_BYTE)) { 
    63                         fprintf(stderr, "Error: Adapter for i2c bus %d does " 
    64                                 "not have byte capability\n", i2cbus); 
     63                        fprintf(stderr, "Error: Adapter does " 
     64                                "not have byte capability\n"); 
    6565                        return -1; 
    6666                } 
     
    6969        case I2C_SMBUS_BYTE_DATA: 
    7070                if (!(funcs & I2C_FUNC_SMBUS_READ_BYTE_DATA)) { 
    71                         fprintf(stderr, "Error: Adapter for i2c bus %d does " 
    72                                 "not have byte read capability\n", i2cbus); 
     71                        fprintf(stderr, "Error: Adapter does " 
     72                                "not have byte read capability\n"); 
    7373                        return -1; 
    7474                } 
     
    7777        case I2C_SMBUS_WORD_DATA: 
    7878                if (!(funcs & I2C_FUNC_SMBUS_READ_WORD_DATA)) { 
    79                         fprintf(stderr, "Error: Adapter for i2c bus %d does " 
    80                                 "not have word read capability\n", i2cbus); 
     79                        fprintf(stderr, "Error: Adapter does " 
     80                                "not have word read capability\n"); 
    8181                        return -1; 
    8282                } 
     
    8585        case I2C_SMBUS_BLOCK_DATA: 
    8686                if (!(funcs & I2C_FUNC_SMBUS_READ_BLOCK_DATA)) { 
    87                         fprintf(stderr, "Error: Adapter for i2c bus %d does " 
    88                                 "not have smbus block read capability\n", 
    89                                 i2cbus); 
     87                        fprintf(stderr, "Error: Adapter does " 
     88                                "not have smbus block read capability\n"); 
    9089                        return -1; 
    9190                } 
     
    9493        case I2C_SMBUS_I2C_BLOCK_DATA: 
    9594                if (!(funcs & I2C_FUNC_SMBUS_READ_I2C_BLOCK)) { 
    96                         fprintf(stderr, "Error: Adapter for i2c bus %d does " 
    97                                 "not have i2c block read capability\n", 
    98                                 i2cbus); 
     95                        fprintf(stderr, "Error: Adapter does " 
     96                                "not have i2c block read capability\n"); 
    9997                        return -1; 
    10098                } 
     
    104102        if (pec 
    105103         && !(funcs & (I2C_FUNC_SMBUS_PEC | I2C_FUNC_I2C))) { 
    106                 fprintf(stderr, "Warning: Adapter for i2c bus %d does " 
    107                         "not seem to support PEC\n", i2cbus); 
     104                fprintf(stderr, "Warning: Adapter does " 
     105                        "not seem to support PEC\n"); 
    108106        } 
    109107 
     
    265263        file = open_i2c_dev(i2cbus, filename, 0); 
    266264        if (file < 0 
    267          || check_funcs(file, i2cbus, size, pec) 
     265         || check_funcs(file, size, pec) 
    268266         || set_slave_addr(file, address, force)) 
    269267                exit(1);