aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/adt7473.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/adt7473.c')
-rw-r--r--drivers/hwmon/adt7473.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c
index 0a6ce2367b42..97ef50833f64 100644
--- a/drivers/hwmon/adt7473.c
+++ b/drivers/hwmon/adt7473.c
@@ -1090,27 +1090,22 @@ static int adt7473_detect(struct i2c_client *client, int kind,
1090 struct i2c_board_info *info) 1090 struct i2c_board_info *info)
1091{ 1091{
1092 struct i2c_adapter *adapter = client->adapter; 1092 struct i2c_adapter *adapter = client->adapter;
1093 int vendor, device, revision;
1093 1094
1094 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 1095 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
1095 return -ENODEV; 1096 return -ENODEV;
1096 1097
1097 if (kind <= 0) { 1098 vendor = i2c_smbus_read_byte_data(client, ADT7473_REG_VENDOR);
1098 int vendor, device, revision; 1099 if (vendor != ADT7473_VENDOR)
1099 1100 return -ENODEV;
1100 vendor = i2c_smbus_read_byte_data(client, ADT7473_REG_VENDOR);
1101 if (vendor != ADT7473_VENDOR)
1102 return -ENODEV;
1103 1101
1104 device = i2c_smbus_read_byte_data(client, ADT7473_REG_DEVICE); 1102 device = i2c_smbus_read_byte_data(client, ADT7473_REG_DEVICE);
1105 if (device != ADT7473_DEVICE) 1103 if (device != ADT7473_DEVICE)
1106 return -ENODEV; 1104 return -ENODEV;
1107 1105
1108 revision = i2c_smbus_read_byte_data(client, 1106 revision = i2c_smbus_read_byte_data(client, ADT7473_REG_REVISION);
1109 ADT7473_REG_REVISION); 1107 if (revision != ADT7473_REV_68 && revision != ADT7473_REV_69)
1110 if (revision != ADT7473_REV_68 && revision != ADT7473_REV_69) 1108 return -ENODEV;
1111 return -ENODEV;
1112 } else
1113 dev_dbg(&adapter->dev, "detection forced\n");
1114 1109
1115 strlcpy(info->type, "adt7473", I2C_NAME_SIZE); 1110 strlcpy(info->type, "adt7473", I2C_NAME_SIZE);
1116 1111