aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/lm90.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 960df9fa75af..116093d0eb3e 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -531,24 +531,24 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, int kind)
531 kind = lm90; 531 kind = lm90;
532 532
533 if (kind < 0) { /* detection and identification */ 533 if (kind < 0) { /* detection and identification */
534 u8 man_id, chip_id, reg_config1, reg_convrate; 534 int man_id, chip_id, reg_config1, reg_convrate;
535 535
536 if (lm90_read_reg(new_client, LM90_REG_R_MAN_ID, 536 if ((man_id = i2c_smbus_read_byte_data(new_client,
537 &man_id) < 0 537 LM90_REG_R_MAN_ID)) < 0
538 || lm90_read_reg(new_client, LM90_REG_R_CHIP_ID, 538 || (chip_id = i2c_smbus_read_byte_data(new_client,
539 &chip_id) < 0 539 LM90_REG_R_CHIP_ID)) < 0
540 || lm90_read_reg(new_client, LM90_REG_R_CONFIG1, 540 || (reg_config1 = i2c_smbus_read_byte_data(new_client,
541 &reg_config1) < 0 541 LM90_REG_R_CONFIG1)) < 0
542 || lm90_read_reg(new_client, LM90_REG_R_CONVRATE, 542 || (reg_convrate = i2c_smbus_read_byte_data(new_client,
543 &reg_convrate) < 0) 543 LM90_REG_R_CONVRATE)) < 0)
544 goto exit_free; 544 goto exit_free;
545 545
546 if ((address == 0x4C || address == 0x4D) 546 if ((address == 0x4C || address == 0x4D)
547 && man_id == 0x01) { /* National Semiconductor */ 547 && man_id == 0x01) { /* National Semiconductor */
548 u8 reg_config2; 548 int reg_config2;
549 549
550 if (lm90_read_reg(new_client, LM90_REG_R_CONFIG2, 550 if ((reg_config2 = i2c_smbus_read_byte_data(new_client,
551 &reg_config2) < 0) 551 LM90_REG_R_CONFIG2)) < 0)
552 goto exit_free; 552 goto exit_free;
553 553
554 if ((reg_config1 & 0x2A) == 0x00 554 if ((reg_config1 & 0x2A) == 0x00