aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/adt7475.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-12-09 14:35:57 -0500
committerJean Delvare <khali@linux-fr.org>2009-12-09 14:35:57 -0500
commit52df6440a29123eed912183fe785bbe174ef14b9 (patch)
tree3a3b9f4110d21c2ec4f5711444dd9cec6fb3d32c /drivers/hwmon/adt7475.c
parenta1fa4cdcc4abd4c02a81ab7052c16a342d29f060 (diff)
hwmon: Clean up detect functions
As kind is now hard-coded to -1, there is room for code clean-ups. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Corentin Labbe <corentin.labbe@geomatys.fr> Cc: "Mark M. Hoffman" <mhoffman@lightlink.com> Cc: Juerg Haefliger <juergh@gmail.com> Cc: Riku Voipio <riku.voipio@iki.fi> Acked-by: "Hans J. Koch" <hjk@linutronix.de> Cc: Rudolf Marek <r.marek@assembler.cz>
Diffstat (limited to 'drivers/hwmon/adt7475.c')
-rw-r--r--drivers/hwmon/adt7475.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
index b5a95193c694..41d3e38f9ce1 100644
--- a/drivers/hwmon/adt7475.c
+++ b/drivers/hwmon/adt7475.c
@@ -974,14 +974,12 @@ static int adt7475_detect(struct i2c_client *client, int kind,
974 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 974 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
975 return -ENODEV; 975 return -ENODEV;
976 976
977 if (kind <= 0) { 977 if (adt7475_read(REG_VENDID) != 0x41 ||
978 if (adt7475_read(REG_VENDID) != 0x41 || 978 adt7475_read(REG_DEVID) != 0x75) {
979 adt7475_read(REG_DEVID) != 0x75) { 979 dev_err(&adapter->dev,
980 dev_err(&adapter->dev, 980 "Couldn't detect a adt7475 part at 0x%02x\n",
981 "Couldn't detect a adt7475 part at 0x%02x\n", 981 (unsigned int)client->addr);
982 (unsigned int)client->addr); 982 return -ENODEV;
983 return -ENODEV;
984 }
985 } 983 }
986 984
987 strlcpy(info->type, adt7475_id[0].name, I2C_NAME_SIZE); 985 strlcpy(info->type, adt7475_id[0].name, I2C_NAME_SIZE);