aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/f75375s.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/f75375s.c')
-rw-r--r--drivers/hwmon/f75375s.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
index e2107e533ede..40dfbcd3f3f2 100644
--- a/drivers/hwmon/f75375s.c
+++ b/drivers/hwmon/f75375s.c
@@ -681,30 +681,20 @@ static int f75375_detect(struct i2c_client *client, int kind,
681 struct i2c_board_info *info) 681 struct i2c_board_info *info)
682{ 682{
683 struct i2c_adapter *adapter = client->adapter; 683 struct i2c_adapter *adapter = client->adapter;
684 u8 version = 0; 684 u16 vendid, chipid;
685 const char *name = ""; 685 u8 version;
686 686 const char *name;
687 if (kind < 0) {
688 u16 vendid = f75375_read16(client, F75375_REG_VENDOR);
689 u16 chipid = f75375_read16(client, F75375_CHIP_ID);
690 version = f75375_read8(client, F75375_REG_VERSION);
691 if (chipid == 0x0306 && vendid == 0x1934) {
692 kind = f75375;
693 } else if (chipid == 0x0204 && vendid == 0x1934) {
694 kind = f75373;
695 } else {
696 dev_err(&adapter->dev,
697 "failed,%02X,%02X,%02X\n",
698 chipid, version, vendid);
699 return -ENODEV;
700 }
701 }
702 687
703 if (kind == f75375) { 688 vendid = f75375_read16(client, F75375_REG_VENDOR);
689 chipid = f75375_read16(client, F75375_CHIP_ID);
690 if (chipid == 0x0306 && vendid == 0x1934)
704 name = "f75375"; 691 name = "f75375";
705 } else if (kind == f75373) { 692 else if (chipid == 0x0204 && vendid == 0x1934)
706 name = "f75373"; 693 name = "f75373";
707 } 694 else
695 return -ENODEV;
696
697 version = f75375_read8(client, F75375_REG_VERSION);
708 dev_info(&adapter->dev, "found %s version: %02X\n", name, version); 698 dev_info(&adapter->dev, "found %s version: %02X\n", name, version);
709 strlcpy(info->type, name, I2C_NAME_SIZE); 699 strlcpy(info->type, name, I2C_NAME_SIZE);
710 700