aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lm90.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/lm90.c')
-rw-r--r--drivers/hwmon/lm90.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c
index 960df9fa75af..f7ec95bedbf6 100644
--- a/drivers/hwmon/lm90.c
+++ b/drivers/hwmon/lm90.c
@@ -204,7 +204,6 @@ static struct i2c_driver lm90_driver = {
204 .driver = { 204 .driver = {
205 .name = "lm90", 205 .name = "lm90",
206 }, 206 },
207 .id = I2C_DRIVERID_LM90,
208 .attach_adapter = lm90_attach_adapter, 207 .attach_adapter = lm90_attach_adapter,
209 .detach_client = lm90_detach_client, 208 .detach_client = lm90_detach_client,
210}; 209};
@@ -531,24 +530,24 @@ static int lm90_detect(struct i2c_adapter *adapter, int address, int kind)
531 kind = lm90; 530 kind = lm90;
532 531
533 if (kind < 0) { /* detection and identification */ 532 if (kind < 0) { /* detection and identification */
534 u8 man_id, chip_id, reg_config1, reg_convrate; 533 int man_id, chip_id, reg_config1, reg_convrate;
535 534
536 if (lm90_read_reg(new_client, LM90_REG_R_MAN_ID, 535 if ((man_id = i2c_smbus_read_byte_data(new_client,
537 &man_id) < 0 536 LM90_REG_R_MAN_ID)) < 0
538 || lm90_read_reg(new_client, LM90_REG_R_CHIP_ID, 537 || (chip_id = i2c_smbus_read_byte_data(new_client,
539 &chip_id) < 0 538 LM90_REG_R_CHIP_ID)) < 0
540 || lm90_read_reg(new_client, LM90_REG_R_CONFIG1, 539 || (reg_config1 = i2c_smbus_read_byte_data(new_client,
541 &reg_config1) < 0 540 LM90_REG_R_CONFIG1)) < 0
542 || lm90_read_reg(new_client, LM90_REG_R_CONVRATE, 541 || (reg_convrate = i2c_smbus_read_byte_data(new_client,
543 &reg_convrate) < 0) 542 LM90_REG_R_CONVRATE)) < 0)
544 goto exit_free; 543 goto exit_free;
545 544
546 if ((address == 0x4C || address == 0x4D) 545 if ((address == 0x4C || address == 0x4D)
547 && man_id == 0x01) { /* National Semiconductor */ 546 && man_id == 0x01) { /* National Semiconductor */
548 u8 reg_config2; 547 int reg_config2;
549 548
550 if (lm90_read_reg(new_client, LM90_REG_R_CONFIG2, 549 if ((reg_config2 = i2c_smbus_read_byte_data(new_client,
551 &reg_config2) < 0) 550 LM90_REG_R_CONFIG2)) < 0)
552 goto exit_free; 551 goto exit_free;
553 552
554 if ((reg_config1 & 0x2A) == 0x00 553 if ((reg_config1 & 0x2A) == 0x00