diff options
Diffstat (limited to 'drivers/hwmon/adt7462.c')
-rw-r--r-- | drivers/hwmon/adt7462.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/hwmon/adt7462.c b/drivers/hwmon/adt7462.c index 1852f27bac51..f9c9562b6a94 100644 --- a/drivers/hwmon/adt7462.c +++ b/drivers/hwmon/adt7462.c | |||
@@ -1906,27 +1906,22 @@ static int adt7462_detect(struct i2c_client *client, int kind, | |||
1906 | struct i2c_board_info *info) | 1906 | struct i2c_board_info *info) |
1907 | { | 1907 | { |
1908 | struct i2c_adapter *adapter = client->adapter; | 1908 | struct i2c_adapter *adapter = client->adapter; |
1909 | int vendor, device, revision; | ||
1909 | 1910 | ||
1910 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 1911 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
1911 | return -ENODEV; | 1912 | return -ENODEV; |
1912 | 1913 | ||
1913 | if (kind <= 0) { | 1914 | vendor = i2c_smbus_read_byte_data(client, ADT7462_REG_VENDOR); |
1914 | int vendor, device, revision; | 1915 | if (vendor != ADT7462_VENDOR) |
1915 | 1916 | return -ENODEV; | |
1916 | vendor = i2c_smbus_read_byte_data(client, ADT7462_REG_VENDOR); | ||
1917 | if (vendor != ADT7462_VENDOR) | ||
1918 | return -ENODEV; | ||
1919 | 1917 | ||
1920 | device = i2c_smbus_read_byte_data(client, ADT7462_REG_DEVICE); | 1918 | device = i2c_smbus_read_byte_data(client, ADT7462_REG_DEVICE); |
1921 | if (device != ADT7462_DEVICE) | 1919 | if (device != ADT7462_DEVICE) |
1922 | return -ENODEV; | 1920 | return -ENODEV; |
1923 | 1921 | ||
1924 | revision = i2c_smbus_read_byte_data(client, | 1922 | revision = i2c_smbus_read_byte_data(client, ADT7462_REG_REVISION); |
1925 | ADT7462_REG_REVISION); | 1923 | if (revision != ADT7462_REVISION) |
1926 | if (revision != ADT7462_REVISION) | 1924 | return -ENODEV; |
1927 | return -ENODEV; | ||
1928 | } else | ||
1929 | dev_dbg(&adapter->dev, "detection forced\n"); | ||
1930 | 1925 | ||
1931 | strlcpy(info->type, "adt7462", I2C_NAME_SIZE); | 1926 | strlcpy(info->type, "adt7462", I2C_NAME_SIZE); |
1932 | 1927 | ||