Changeset 5240 for i2c-tools/trunk/tools/i2cset.c
- Timestamp:
- 05/05/08 16:54:18 (4 years ago)
- Files:
-
- 1 modified
-
i2c-tools/trunk/tools/i2cset.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
i2c-tools/trunk/tools/i2cset.c
r5237 r5240 46 46 } 47 47 48 static int check_funcs(int file, int i2cbus, intsize, int pec)48 static int check_funcs(int file, int size, int pec) 49 49 { 50 50 unsigned long funcs; … … 60 60 case I2C_SMBUS_BYTE: 61 61 if (!(funcs & I2C_FUNC_SMBUS_WRITE_BYTE)) { 62 fprintf(stderr, "Error: Adapter for i2c bus %ddoes "63 "not have byte send capability\n" , i2cbus);62 fprintf(stderr, "Error: Adapter does " 63 "not have byte send capability\n"); 64 64 return -1; 65 65 } … … 68 68 case I2C_SMBUS_BYTE_DATA: 69 69 if (!(funcs & I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) { 70 fprintf(stderr, "Error: Adapter for i2c bus %ddoes "71 "not have byte write capability\n" , i2cbus);70 fprintf(stderr, "Error: Adapter does " 71 "not have byte write capability\n"); 72 72 return -1; 73 73 } … … 76 76 case I2C_SMBUS_WORD_DATA: 77 77 if (!(funcs & I2C_FUNC_SMBUS_WRITE_WORD_DATA)) { 78 fprintf(stderr, "Error: Adapter for i2c bus %ddoes "79 "not have word write capability\n" , i2cbus);78 fprintf(stderr, "Error: Adapter does " 79 "not have word write capability\n"); 80 80 return -1; 81 81 } … … 85 85 if (pec 86 86 && !(funcs & (I2C_FUNC_SMBUS_PEC | I2C_FUNC_I2C))) { 87 fprintf(stderr, "Warning: Adapter for i2c bus %ddoes "88 "not seem to support PEC\n" , i2cbus);87 fprintf(stderr, "Warning: Adapter does " 88 "not seem to support PEC\n"); 89 89 } 90 90 … … 215 215 file = open_i2c_dev(i2cbus, filename, 0); 216 216 if (file < 0 217 || check_funcs(file, i2cbus,size, pec)217 || check_funcs(file, size, pec) 218 218 || set_slave_addr(file, address, force)) 219 219 exit(1);
