Changeset 5240 for i2c-tools/trunk/tools/i2cdump.c
- Timestamp:
- 05/05/08 16:54:18 (4 years ago)
- Files:
-
- 1 modified
-
i2c-tools/trunk/tools/i2cdump.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i2c-tools/trunk/tools/i2cdump.c
r5239 r5240 47 47 } 48 48 49 static int check_funcs(int file, int i2cbus, intsize, int pec)49 static int check_funcs(int file, int size, int pec) 50 50 { 51 51 unsigned long funcs; … … 61 61 case I2C_SMBUS_BYTE: 62 62 if (!((funcs & I2C_FUNC_SMBUS_BYTE) == I2C_FUNC_SMBUS_BYTE)) { 63 fprintf(stderr, "Error: Adapter for i2c bus %ddoes "64 "not have byte capability\n" , i2cbus);63 fprintf(stderr, "Error: Adapter does " 64 "not have byte capability\n"); 65 65 return -1; 66 66 } … … 69 69 case I2C_SMBUS_BYTE_DATA: 70 70 if (!(funcs & I2C_FUNC_SMBUS_READ_BYTE_DATA)) { 71 fprintf(stderr, "Error: Adapter for i2c bus %ddoes "72 "not have byte read capability\n" , i2cbus);71 fprintf(stderr, "Error: Adapter does " 72 "not have byte read capability\n"); 73 73 return -1; 74 74 } … … 77 77 case I2C_SMBUS_WORD_DATA: 78 78 if (!(funcs & I2C_FUNC_SMBUS_READ_WORD_DATA)) { 79 fprintf(stderr, "Error: Adapter for i2c bus %ddoes "80 "not have word read capability\n" , i2cbus);79 fprintf(stderr, "Error: Adapter does " 80 "not have word read capability\n"); 81 81 return -1; 82 82 } … … 85 85 case I2C_SMBUS_BLOCK_DATA: 86 86 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"); 90 89 return -1; 91 90 } … … 94 93 case I2C_SMBUS_I2C_BLOCK_DATA: 95 94 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"); 99 97 return -1; 100 98 } … … 104 102 if (pec 105 103 && !(funcs & (I2C_FUNC_SMBUS_PEC | I2C_FUNC_I2C))) { 106 fprintf(stderr, "Warning: Adapter for i2c bus %ddoes "107 "not seem to support PEC\n" , i2cbus);104 fprintf(stderr, "Warning: Adapter does " 105 "not seem to support PEC\n"); 108 106 } 109 107 … … 265 263 file = open_i2c_dev(i2cbus, filename, 0); 266 264 if (file < 0 267 || check_funcs(file, i2cbus,size, pec)265 || check_funcs(file, size, pec) 268 266 || set_slave_addr(file, address, force)) 269 267 exit(1);
