diff options
author | David S. Miller <davem@davemloft.net> | 2009-12-12 02:12:17 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-12 02:12:17 +0100 |
commit | 501706565b2d4d2d40d0d301d5411ede099b8a6f (patch) | |
tree | 142a18bf1f1e74a09dbfa27540b893ade0fd797d /drivers/hwmon/f75375s.c | |
parent | net: Handle NETREG_UNINITIALIZED devices correctly (diff) | |
parent | Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cp... (diff) | |
download | linux-501706565b2d4d2d40d0d301d5411ede099b8a6f.tar.xz linux-501706565b2d4d2d40d0d301d5411ede099b8a6f.zip |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts:
include/net/tcp.h
Diffstat (limited to 'drivers/hwmon/f75375s.c')
-rw-r--r-- | drivers/hwmon/f75375s.c | 32 |
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, struct i2c_board_info *info) { struct i2c_adapter *adapter = client->adapter; - u8 version = 0; - const char *name = ""; - - if (kind < 0) { - u16 vendid = f75375_read16(client, F75375_REG_VENDOR); - u16 chipid = f75375_read16(client, F75375_CHIP_ID); - version = f75375_read8(client, F75375_REG_VERSION); - if (chipid == 0x0306 && vendid == 0x1934) { - kind = f75375; - } else if (chipid == 0x0204 && vendid == 0x1934) { - kind = f75373; - } else { - dev_err(&adapter->dev, - "failed,%02X,%02X,%02X\n", - chipid, version, vendid); - return -ENODEV; - } - } + u16 vendid, chipid; + u8 version; + const char *name; - if (kind == f75375) { + vendid = f75375_read16(client, F75375_REG_VENDOR); + chipid = f75375_read16(client, F75375_CHIP_ID); + if (chipid == 0x0306 && vendid == 0x1934) name = "f75375"; - } else if (kind == f75373) { + else if (chipid == 0x0204 && vendid == 0x1934) name = "f75373"; - } + else + return -ENODEV; + + version = f75375_read8(client, F75375_REG_VERSION); dev_info(&adapter->dev, "found %s version: %02X\n", name, version); strlcpy(info->type, name, I2C_NAME_SIZE); |