From 52df6440a29123eed912183fe785bbe174ef14b9 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 9 Dec 2009 20:35:57 +0100 Subject: 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 Acked-by: Corentin Labbe Cc: "Mark M. Hoffman" Cc: Juerg Haefliger Cc: Riku Voipio Acked-by: "Hans J. Koch" Cc: Rudolf Marek --- drivers/hwmon/adt7473.c | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'drivers/hwmon/adt7473.c') diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c index 0a6ce2367b4..97ef50833f6 100644 --- a/drivers/hwmon/adt7473.c +++ b/drivers/hwmon/adt7473.c @@ -1090,27 +1090,22 @@ static int adt7473_detect(struct i2c_client *client, int kind, struct i2c_board_info *info) { struct i2c_adapter *adapter = client->adapter; + int vendor, device, revision; if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) return -ENODEV; - if (kind <= 0) { - int vendor, device, revision; - - vendor = i2c_smbus_read_byte_data(client, ADT7473_REG_VENDOR); - if (vendor != ADT7473_VENDOR) - return -ENODEV; + vendor = i2c_smbus_read_byte_data(client, ADT7473_REG_VENDOR); + if (vendor != ADT7473_VENDOR) + return -ENODEV; - device = i2c_smbus_read_byte_data(client, ADT7473_REG_DEVICE); - if (device != ADT7473_DEVICE) - return -ENODEV; + device = i2c_smbus_read_byte_data(client, ADT7473_REG_DEVICE); + if (device != ADT7473_DEVICE) + return -ENODEV; - revision = i2c_smbus_read_byte_data(client, - ADT7473_REG_REVISION); - if (revision != ADT7473_REV_68 && revision != ADT7473_REV_69) - return -ENODEV; - } else - dev_dbg(&adapter->dev, "detection forced\n"); + revision = i2c_smbus_read_byte_data(client, ADT7473_REG_REVISION); + if (revision != ADT7473_REV_68 && revision != ADT7473_REV_69) + return -ENODEV; strlcpy(info->type, "adt7473", I2C_NAME_SIZE); -- cgit v1.2.3 From b180d0508475c5c55085839d22f454c69379eacc Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 9 Dec 2009 20:36:02 +0100 Subject: hwmon: (adt7475) Add support for the ADT7473 Add support for the ADT7473 to the adt7475 driver, and mark the adt7473 driver for removal. The ADT7473 and ADT7475 chips are almost the same chip and essentially compatible, so there's no point in having separate drivers for them. Signed-off-by: Jean Delvare Cc: "Mark M. Hoffman" Cc: Hans de Goede Cc: Jordan Crouse Cc: "Darrick J. Wong" --- drivers/hwmon/adt7473.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/hwmon/adt7473.c') diff --git a/drivers/hwmon/adt7473.c b/drivers/hwmon/adt7473.c index 97ef50833f6..aea244db974 100644 --- a/drivers/hwmon/adt7473.c +++ b/drivers/hwmon/adt7473.c @@ -174,7 +174,6 @@ static const struct i2c_device_id adt7473_id[] = { { "adt7473", adt7473 }, { } }; -MODULE_DEVICE_TABLE(i2c, adt7473_id); static struct i2c_driver adt7473_driver = { .class = I2C_CLASS_HWMON, @@ -1166,6 +1165,8 @@ static int adt7473_remove(struct i2c_client *client) static int __init adt7473_init(void) { + pr_notice("The adt7473 driver is deprecated, please use the adt7475 " + "driver instead\n"); return i2c_add_driver(&adt7473_driver); } -- cgit v1.2.3