aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/smsc47m192.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/smsc47m192.c')
-rw-r--r--drivers/hwmon/smsc47m192.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/hwmon/smsc47m192.c b/drivers/hwmon/smsc47m192.c
index 8bb5cb532d4d..4d88c045781c 100644
--- a/drivers/hwmon/smsc47m192.c
+++ b/drivers/hwmon/smsc47m192.c
@@ -491,24 +491,22 @@ static int smsc47m192_detect(struct i2c_client *client, int kind,
491 return -ENODEV; 491 return -ENODEV;
492 492
493 /* Detection criteria from sensors_detect script */ 493 /* Detection criteria from sensors_detect script */
494 if (kind < 0) { 494 version = i2c_smbus_read_byte_data(client, SMSC47M192_REG_VERSION);
495 if (i2c_smbus_read_byte_data(client, 495 if (i2c_smbus_read_byte_data(client,
496 SMSC47M192_REG_COMPANY_ID) == 0x55 496 SMSC47M192_REG_COMPANY_ID) == 0x55
497 && ((version = i2c_smbus_read_byte_data(client, 497 && (version & 0xf0) == 0x20
498 SMSC47M192_REG_VERSION)) & 0xf0) == 0x20 498 && (i2c_smbus_read_byte_data(client,
499 && (i2c_smbus_read_byte_data(client,
500 SMSC47M192_REG_VID) & 0x70) == 0x00 499 SMSC47M192_REG_VID) & 0x70) == 0x00
501 && (i2c_smbus_read_byte_data(client, 500 && (i2c_smbus_read_byte_data(client,
502 SMSC47M192_REG_VID4) & 0xfe) == 0x80) { 501 SMSC47M192_REG_VID4) & 0xfe) == 0x80) {
503 dev_info(&adapter->dev, 502 dev_info(&adapter->dev,
504 "found SMSC47M192 or compatible, " 503 "found SMSC47M192 or compatible, "
505 "version 2, stepping A%d\n", version & 0x0f); 504 "version 2, stepping A%d\n", version & 0x0f);
506 } else { 505 } else {
507 dev_dbg(&adapter->dev, 506 dev_dbg(&adapter->dev,
508 "SMSC47M192 detection failed at 0x%02x\n", 507 "SMSC47M192 detection failed at 0x%02x\n",
509 client->addr); 508 client->addr);
510 return -ENODEV; 509 return -ENODEV;
511 }
512 } 510 }
513 511
514 strlcpy(info->type, "smsc47m192", I2C_NAME_SIZE); 512 strlcpy(info->type, "smsc47m192", I2C_NAME_SIZE);