diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-09 22:53:11 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-09 22:53:11 -0500 |
commit | f71eaf68406cfee91b6a96bcdf7ce33dc78829c5 (patch) | |
tree | 92a1663ae15d521f25849d28ebb4dfad10567892 /drivers/hwmon/lm93.c | |
parent | 78f1ae193d1662c22cfebb916e788e1ca896c0fe (diff) | |
parent | 54fe4671aa5853ca88da72d67e969a3d8de6dcf6 (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/lm93.c')
-rw-r--r-- | drivers/hwmon/lm93.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/hwmon/lm93.c b/drivers/hwmon/lm93.c index c48a284b8314..124dd7cea54c 100644 --- a/drivers/hwmon/lm93.c +++ b/drivers/hwmon/lm93.c | |||
@@ -2505,34 +2505,24 @@ static int lm93_detect(struct i2c_client *client, int kind, | |||
2505 | struct i2c_board_info *info) | 2505 | struct i2c_board_info *info) |
2506 | { | 2506 | { |
2507 | struct i2c_adapter *adapter = client->adapter; | 2507 | struct i2c_adapter *adapter = client->adapter; |
2508 | int mfr, ver; | ||
2508 | 2509 | ||
2509 | if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN)) | 2510 | if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN)) |
2510 | return -ENODEV; | 2511 | return -ENODEV; |
2511 | 2512 | ||
2512 | /* detection */ | 2513 | /* detection */ |
2513 | if (kind < 0) { | 2514 | mfr = lm93_read_byte(client, LM93_REG_MFR_ID); |
2514 | int mfr = lm93_read_byte(client, LM93_REG_MFR_ID); | 2515 | if (mfr != 0x01) { |
2515 | 2516 | dev_dbg(&adapter->dev, | |
2516 | if (mfr != 0x01) { | 2517 | "detect failed, bad manufacturer id 0x%02x!\n", mfr); |
2517 | dev_dbg(&adapter->dev,"detect failed, " | 2518 | return -ENODEV; |
2518 | "bad manufacturer id 0x%02x!\n", mfr); | ||
2519 | return -ENODEV; | ||
2520 | } | ||
2521 | } | 2519 | } |
2522 | 2520 | ||
2523 | if (kind <= 0) { | 2521 | ver = lm93_read_byte(client, LM93_REG_VER); |
2524 | int ver = lm93_read_byte(client, LM93_REG_VER); | 2522 | if (ver != LM93_MFR_ID && ver != LM93_MFR_ID_PROTOTYPE) { |
2525 | 2523 | dev_dbg(&adapter->dev, | |
2526 | if ((ver == LM93_MFR_ID) || (ver == LM93_MFR_ID_PROTOTYPE)) { | 2524 | "detect failed, bad version id 0x%02x!\n", ver); |
2527 | kind = lm93; | 2525 | return -ENODEV; |
2528 | } else { | ||
2529 | dev_dbg(&adapter->dev,"detect failed, " | ||
2530 | "bad version id 0x%02x!\n", ver); | ||
2531 | if (kind == 0) | ||
2532 | dev_dbg(&adapter->dev, | ||
2533 | "(ignored 'force' parameter)\n"); | ||
2534 | return -ENODEV; | ||
2535 | } | ||
2536 | } | 2526 | } |
2537 | 2527 | ||
2538 | strlcpy(info->type, "lm93", I2C_NAME_SIZE); | 2528 | strlcpy(info->type, "lm93", I2C_NAME_SIZE); |