aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/gl520sm.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-12-09 14:35:57 -0500
committerJean Delvare <khali@linux-fr.org>2009-12-09 14:35:57 -0500
commit52df6440a29123eed912183fe785bbe174ef14b9 (patch)
tree3a3b9f4110d21c2ec4f5711444dd9cec6fb3d32c /drivers/hwmon/gl520sm.c
parenta1fa4cdcc4abd4c02a81ab7052c16a342d29f060 (diff)
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>
Diffstat (limited to 'drivers/hwmon/gl520sm.c')
-rw-r--r--drivers/hwmon/gl520sm.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/hwmon/gl520sm.c b/drivers/hwmon/gl520sm.c
index 19616f2242b0..92b5720ceaff 100644
--- a/drivers/hwmon/gl520sm.c
+++ b/drivers/hwmon/gl520sm.c
@@ -691,13 +691,11 @@ static int gl520_detect(struct i2c_client *client, int kind,
691 return -ENODEV; 691 return -ENODEV;
692 692
693 /* Determine the chip type. */ 693 /* Determine the chip type. */
694 if (kind < 0) { 694 if ((gl520_read_value(client, GL520_REG_CHIP_ID) != 0x20) ||
695 if ((gl520_read_value(client, GL520_REG_CHIP_ID) != 0x20) || 695 ((gl520_read_value(client, GL520_REG_REVISION) & 0x7f) != 0x00) ||
696 ((gl520_read_value(client, GL520_REG_REVISION) & 0x7f) != 0x00) || 696 ((gl520_read_value(client, GL520_REG_CONF) & 0x80) != 0x00)) {
697 ((gl520_read_value(client, GL520_REG_CONF) & 0x80) != 0x00)) { 697 dev_dbg(&client->dev, "Unknown chip type, skipping\n");
698 dev_dbg(&client->dev, "Unknown chip type, skipping\n"); 698 return -ENODEV;
699 return -ENODEV;
700 }
701 } 699 }
702 700
703 strlcpy(info->type, "gl520sm", I2C_NAME_SIZE); 701 strlcpy(info->type, "gl520sm", I2C_NAME_SIZE);