Loading drivers/hwmon/lm77.c +39 −41 Original line number Diff line number Diff line Loading @@ -249,6 +249,7 @@ static int lm77_detect(struct i2c_client *new_client, int kind, struct i2c_board_info *info) { struct i2c_adapter *adapter = new_client->adapter; int i, cur, conf, hyst, crit, min, max; if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) Loading @@ -265,8 +266,6 @@ static int lm77_detect(struct i2c_client *new_client, int kind, 4. registers cycling over 8-address boundaries Word-sized registers are high-byte first. */ if (kind < 0) { int i, cur, conf, hyst, crit, min, max; /* addresses cycling */ cur = i2c_smbus_read_word_data(new_client, 0); Loading @@ -275,13 +274,14 @@ static int lm77_detect(struct i2c_client *new_client, int kind, crit = i2c_smbus_read_word_data(new_client, 3); min = i2c_smbus_read_word_data(new_client, 4); max = i2c_smbus_read_word_data(new_client, 5); for (i = 8; i <= 0xff; i += 8) for (i = 8; i <= 0xff; i += 8) { if (i2c_smbus_read_byte_data(new_client, i + 1) != conf || i2c_smbus_read_word_data(new_client, i + 2) != hyst || i2c_smbus_read_word_data(new_client, i + 3) != crit || i2c_smbus_read_word_data(new_client, i + 4) != min || i2c_smbus_read_word_data(new_client, i + 5) != max) return -ENODEV; } /* sign bits */ if (((cur & 0x00f0) != 0xf0 && (cur & 0x00f0) != 0x0) Loading Loading @@ -309,8 +309,6 @@ static int lm77_detect(struct i2c_client *new_client, int kind, || i2c_smbus_read_word_data(new_client, 7) != min) return -ENODEV; } strlcpy(info->type, "lm77", I2C_NAME_SIZE); return 0; Loading Loading
drivers/hwmon/lm77.c +39 −41 Original line number Diff line number Diff line Loading @@ -249,6 +249,7 @@ static int lm77_detect(struct i2c_client *new_client, int kind, struct i2c_board_info *info) { struct i2c_adapter *adapter = new_client->adapter; int i, cur, conf, hyst, crit, min, max; if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | I2C_FUNC_SMBUS_WORD_DATA)) Loading @@ -265,8 +266,6 @@ static int lm77_detect(struct i2c_client *new_client, int kind, 4. registers cycling over 8-address boundaries Word-sized registers are high-byte first. */ if (kind < 0) { int i, cur, conf, hyst, crit, min, max; /* addresses cycling */ cur = i2c_smbus_read_word_data(new_client, 0); Loading @@ -275,13 +274,14 @@ static int lm77_detect(struct i2c_client *new_client, int kind, crit = i2c_smbus_read_word_data(new_client, 3); min = i2c_smbus_read_word_data(new_client, 4); max = i2c_smbus_read_word_data(new_client, 5); for (i = 8; i <= 0xff; i += 8) for (i = 8; i <= 0xff; i += 8) { if (i2c_smbus_read_byte_data(new_client, i + 1) != conf || i2c_smbus_read_word_data(new_client, i + 2) != hyst || i2c_smbus_read_word_data(new_client, i + 3) != crit || i2c_smbus_read_word_data(new_client, i + 4) != min || i2c_smbus_read_word_data(new_client, i + 5) != max) return -ENODEV; } /* sign bits */ if (((cur & 0x00f0) != 0xf0 && (cur & 0x00f0) != 0x0) Loading Loading @@ -309,8 +309,6 @@ static int lm77_detect(struct i2c_client *new_client, int kind, || i2c_smbus_read_word_data(new_client, 7) != min) return -ENODEV; } strlcpy(info->type, "lm77", I2C_NAME_SIZE); return 0; Loading