summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/gl518sm.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-12-10 15:40:31 +0900
committerPaul Mundt <lethal@linux-sh.org>2009-12-10 15:40:31 +0900
commitb5c00a3a412857d6f07970984068c450429e051c (patch)
tree1fde50630cbc24e11a45169f717f281db8eb6dcc /drivers/hwmon/gl518sm.c
parentca6f2d7fafd2d48b2f6943f5c6787beaec2014d0 (diff)
parent3067e02f8f3ae2f3f02ba76400d03b8bcb4942b0 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into sh/for-2.6.33
Diffstat (limited to 'drivers/hwmon/gl518sm.c')
-rw-r--r--drivers/hwmon/gl518sm.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/drivers/hwmon/gl518sm.c b/drivers/hwmon/gl518sm.c
index 7820df45d77..1d69458aa0b 100644
--- a/drivers/hwmon/gl518sm.c
+++ b/drivers/hwmon/gl518sm.c
@@ -488,36 +488,21 @@ static int gl518_detect(struct i2c_client *client, int kind,
struct i2c_board_info *info)
{
struct i2c_adapter *adapter = client->adapter;
- int i;
+ int rev;
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA |
I2C_FUNC_SMBUS_WORD_DATA))
return -ENODEV;
/* Now, we do the remaining detection. */
-
- if (kind < 0) {
- if ((gl518_read_value(client, GL518_REG_CHIP_ID) != 0x80)
- || (gl518_read_value(client, GL518_REG_CONF) & 0x80))
- return -ENODEV;
- }
+ if ((gl518_read_value(client, GL518_REG_CHIP_ID) != 0x80)
+ || (gl518_read_value(client, GL518_REG_CONF) & 0x80))
+ return -ENODEV;
/* Determine the chip type. */
- if (kind <= 0) {
- i = gl518_read_value(client, GL518_REG_REVISION);
- if (i == 0x00) {
- kind = gl518sm_r00;
- } else if (i == 0x80) {
- kind = gl518sm_r80;
- } else {
- if (kind <= 0)
- dev_info(&adapter->dev,
- "Ignoring 'force' parameter for unknown "
- "chip at adapter %d, address 0x%02x\n",
- i2c_adapter_id(adapter), client->addr);
- return -ENODEV;
- }
- }
+ rev = gl518_read_value(client, GL518_REG_REVISION);
+ if (rev != 0x00 && rev != 0x80)
+ return -ENODEV;
strlcpy(info->type, "gl518sm", I2C_NAME_SIZE);