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>
This commit is contained in:
Jean Delvare
2009-12-09 20:35:57 +01:00
parent a1fa4cdcc4
commit 52df6440a2
29 changed files with 385 additions and 706 deletions

View File

@ -974,14 +974,12 @@ static int adt7475_detect(struct i2c_client *client, int kind,
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
return -ENODEV;
if (kind <= 0) {
if (adt7475_read(REG_VENDID) != 0x41 ||
adt7475_read(REG_DEVID) != 0x75) {
dev_err(&adapter->dev,
"Couldn't detect a adt7475 part at 0x%02x\n",
(unsigned int)client->addr);
return -ENODEV;
}
if (adt7475_read(REG_VENDID) != 0x41 ||
adt7475_read(REG_DEVID) != 0x75) {
dev_err(&adapter->dev,
"Couldn't detect a adt7475 part at 0x%02x\n",
(unsigned int)client->addr);
return -ENODEV;
}
strlcpy(info->type, adt7475_id[0].name, I2C_NAME_SIZE);