aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/adt7470.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:53:11 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:53:11 -0500
commitf71eaf68406cfee91b6a96bcdf7ce33dc78829c5 (patch)
tree92a1663ae15d521f25849d28ebb4dfad10567892 /drivers/hwmon/adt7470.c
parent78f1ae193d1662c22cfebb916e788e1ca896c0fe (diff)
parent54fe4671aa5853ca88da72d67e969a3d8de6dcf6 (diff)
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging: (41 commits) hwmon: (adt7475) Add VID support for the ADT7476 hwmon: (adt7475) Add an entry in MAINTAINERS hwmon: (adt7475) Add support for the ADT7476 hwmon: (adt7475) Voltage attenuators can be bypassed hwmon: (adt7475) Print device information on probe hwmon: (adt7475) Handle alternative pin functions hwmon: (adt7475) Move sysfs files removal to a separate function hwmon: (adt7475) Add support for the ADT7490 hwmon: (adt7475) Improve device detection hwmon: (adt7475) Add missing static marker hwmon: (adt7475) Rework voltage inputs handling hwmon: (adt7475) Implement pwm_use_point2_pwm_at_crit hwmon: (adt7475) New documentation hwmon: (adt7475) Add support for the ADT7473 hwmon: (f71882fg) Add support for the f71889fg (version 2) hwmon: (f71882fg) Fix sysfs file removal hwmon: (f71882fg) Cleanup sysfs attr creation 2/2 hwmon: (f71882fg) Cleanup sysfs attr creation 1/2 hwmon: (thmc50) Stop using I2C_CLIENT_MODULE_PARM hwmon: Add Freescale MC13783 ADC driver ...
Diffstat (limited to 'drivers/hwmon/adt7470.c')
-rw-r--r--drivers/hwmon/adt7470.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c
index 633e1a1e9d79..32b1750a6890 100644
--- a/drivers/hwmon/adt7470.c
+++ b/drivers/hwmon/adt7470.c
@@ -1229,27 +1229,22 @@ static int adt7470_detect(struct i2c_client *client, int kind,
1229 struct i2c_board_info *info) 1229 struct i2c_board_info *info)
1230{ 1230{
1231 struct i2c_adapter *adapter = client->adapter; 1231 struct i2c_adapter *adapter = client->adapter;
1232 int vendor, device, revision;
1232 1233
1233 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 1234 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
1234 return -ENODEV; 1235 return -ENODEV;
1235 1236
1236 if (kind <= 0) { 1237 vendor = i2c_smbus_read_byte_data(client, ADT7470_REG_VENDOR);
1237 int vendor, device, revision; 1238 if (vendor != ADT7470_VENDOR)
1238 1239 return -ENODEV;
1239 vendor = i2c_smbus_read_byte_data(client, ADT7470_REG_VENDOR);
1240 if (vendor != ADT7470_VENDOR)
1241 return -ENODEV;
1242 1240
1243 device = i2c_smbus_read_byte_data(client, ADT7470_REG_DEVICE); 1241 device = i2c_smbus_read_byte_data(client, ADT7470_REG_DEVICE);
1244 if (device != ADT7470_DEVICE) 1242 if (device != ADT7470_DEVICE)
1245 return -ENODEV; 1243 return -ENODEV;
1246 1244
1247 revision = i2c_smbus_read_byte_data(client, 1245 revision = i2c_smbus_read_byte_data(client, ADT7470_REG_REVISION);
1248 ADT7470_REG_REVISION); 1246 if (revision != ADT7470_REVISION)
1249 if (revision != ADT7470_REVISION) 1247 return -ENODEV;
1250 return -ENODEV;
1251 } else
1252 dev_dbg(&adapter->dev, "detection forced\n");
1253 1248
1254 strlcpy(info->type, "adt7470", I2C_NAME_SIZE); 1249 strlcpy(info->type, "adt7470", I2C_NAME_SIZE);
1255 1250