diff options
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/max1619.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/hwmon/max1619.c b/drivers/hwmon/max1619.c index 6a82ffae1bfd..69e7e125683b 100644 --- a/drivers/hwmon/max1619.c +++ b/drivers/hwmon/max1619.c | |||
@@ -193,7 +193,7 @@ static int max1619_detect(struct i2c_adapter *adapter, int address, int kind) | |||
193 | int err = 0; | 193 | int err = 0; |
194 | const char *name = ""; | 194 | const char *name = ""; |
195 | u8 reg_config=0, reg_convrate=0, reg_status=0; | 195 | u8 reg_config=0, reg_convrate=0, reg_status=0; |
196 | u8 man_id, chip_id; | 196 | |
197 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) | 197 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) |
198 | goto exit; | 198 | goto exit; |
199 | 199 | ||
@@ -238,16 +238,15 @@ static int max1619_detect(struct i2c_adapter *adapter, int address, int kind) | |||
238 | } | 238 | } |
239 | 239 | ||
240 | if (kind <= 0) { /* identification */ | 240 | if (kind <= 0) { /* identification */ |
241 | u8 man_id, chip_id; | ||
241 | 242 | ||
242 | man_id = i2c_smbus_read_byte_data(new_client, | 243 | man_id = i2c_smbus_read_byte_data(new_client, |
243 | MAX1619_REG_R_MAN_ID); | 244 | MAX1619_REG_R_MAN_ID); |
244 | chip_id = i2c_smbus_read_byte_data(new_client, | 245 | chip_id = i2c_smbus_read_byte_data(new_client, |
245 | MAX1619_REG_R_CHIP_ID); | 246 | MAX1619_REG_R_CHIP_ID); |
246 | 247 | ||
247 | if ((man_id == 0x4D) && (chip_id == 0x04)){ | 248 | if ((man_id == 0x4D) && (chip_id == 0x04)) |
248 | kind = max1619; | 249 | kind = max1619; |
249 | } | ||
250 | } | ||
251 | 250 | ||
252 | if (kind <= 0) { /* identification failed */ | 251 | if (kind <= 0) { /* identification failed */ |
253 | dev_info(&adapter->dev, | 252 | dev_info(&adapter->dev, |
@@ -255,11 +254,10 @@ static int max1619_detect(struct i2c_adapter *adapter, int address, int kind) | |||
255 | "chip_id=0x%02X).\n", man_id, chip_id); | 254 | "chip_id=0x%02X).\n", man_id, chip_id); |
256 | goto exit_free; | 255 | goto exit_free; |
257 | } | 256 | } |
258 | 257 | } | |
259 | 258 | ||
260 | if (kind == max1619){ | 259 | if (kind == max1619) |
261 | name = "max1619"; | 260 | name = "max1619"; |
262 | } | ||
263 | 261 | ||
264 | /* We can fill in the remaining client fields */ | 262 | /* We can fill in the remaining client fields */ |
265 | strlcpy(new_client->name, name, I2C_NAME_SIZE); | 263 | strlcpy(new_client->name, name, I2C_NAME_SIZE); |