diff options
Diffstat (limited to 'drivers/hwmon/lm90.c')
-rw-r--r-- | drivers/hwmon/lm90.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 90ddb8774210..60b3e3030277 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c | |||
@@ -1117,14 +1117,12 @@ static int lm90_detect(struct i2c_client *new_client, | |||
1117 | return -ENODEV; | 1117 | return -ENODEV; |
1118 | 1118 | ||
1119 | /* detection and identification */ | 1119 | /* detection and identification */ |
1120 | if ((man_id = i2c_smbus_read_byte_data(new_client, | 1120 | man_id = i2c_smbus_read_byte_data(new_client, LM90_REG_R_MAN_ID); |
1121 | LM90_REG_R_MAN_ID)) < 0 | 1121 | chip_id = i2c_smbus_read_byte_data(new_client, LM90_REG_R_CHIP_ID); |
1122 | || (chip_id = i2c_smbus_read_byte_data(new_client, | 1122 | reg_config1 = i2c_smbus_read_byte_data(new_client, LM90_REG_R_CONFIG1); |
1123 | LM90_REG_R_CHIP_ID)) < 0 | 1123 | reg_convrate = i2c_smbus_read_byte_data(new_client, |
1124 | || (reg_config1 = i2c_smbus_read_byte_data(new_client, | 1124 | LM90_REG_R_CONVRATE); |
1125 | LM90_REG_R_CONFIG1)) < 0 | 1125 | if (man_id < 0 || chip_id < 0 || reg_config1 < 0 || reg_convrate < 0) |
1126 | || (reg_convrate = i2c_smbus_read_byte_data(new_client, | ||
1127 | LM90_REG_R_CONVRATE)) < 0) | ||
1128 | return -ENODEV; | 1126 | return -ENODEV; |
1129 | 1127 | ||
1130 | if (man_id == 0x01 || man_id == 0x5C || man_id == 0x41) { | 1128 | if (man_id == 0x01 || man_id == 0x5C || man_id == 0x41) { |
@@ -1192,13 +1190,16 @@ static int lm90_detect(struct i2c_client *new_client, | |||
1192 | * exists, both readings will reflect the same value. Otherwise, | 1190 | * exists, both readings will reflect the same value. Otherwise, |
1193 | * the readings will be different. | 1191 | * the readings will be different. |
1194 | */ | 1192 | */ |
1195 | if ((reg_emerg = i2c_smbus_read_byte_data(new_client, | 1193 | reg_emerg = i2c_smbus_read_byte_data(new_client, |
1196 | MAX6659_REG_R_REMOTE_EMERG)) < 0 | 1194 | MAX6659_REG_R_REMOTE_EMERG); |
1197 | || i2c_smbus_read_byte_data(new_client, LM90_REG_R_MAN_ID) < 0 | 1195 | man_id = i2c_smbus_read_byte_data(new_client, |
1198 | || (reg_emerg2 = i2c_smbus_read_byte_data(new_client, | 1196 | LM90_REG_R_MAN_ID); |
1199 | MAX6659_REG_R_REMOTE_EMERG)) < 0 | 1197 | reg_emerg2 = i2c_smbus_read_byte_data(new_client, |
1200 | || (reg_status2 = i2c_smbus_read_byte_data(new_client, | 1198 | MAX6659_REG_R_REMOTE_EMERG); |
1201 | MAX6696_REG_R_STATUS2)) < 0) | 1199 | reg_status2 = i2c_smbus_read_byte_data(new_client, |
1200 | MAX6696_REG_R_STATUS2); | ||
1201 | if (reg_emerg < 0 || man_id < 0 || reg_emerg2 < 0 | ||
1202 | || reg_status2 < 0) | ||
1202 | return -ENODEV; | 1203 | return -ENODEV; |
1203 | 1204 | ||
1204 | /* | 1205 | /* |