aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lm87.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2008-10-17 11:51:11 -0400
committerJean Delvare <khali@mahadeva.delvare>2008-10-17 11:51:11 -0400
commit49ae6cc8005f45edadf237089c31885834f2608e (patch)
treeb8fa52e5eb4af19f7ff7438067cf2876ca382a06 /drivers/hwmon/lm87.c
parent4b4e7a72fda549e309919931d8a39dea4e5b4be1 (diff)
hwmon: (lm87) Fix masking of config register in lm87_init_client()
lm87_init_client() conditionally sets the Start bit and clears the INT#_Clear bit in the Config 1 register. The condition should be that either of these bits needs changing, but currently it checks the (self-clearing) Initialization bit instead of INT#_Clear. Fix the condition and also ensure we never set the Initialization bit. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/lm87.c')
-rw-r--r--drivers/hwmon/lm87.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c
index 21970f0d53a1..0fecbfd2ba5b 100644
--- a/drivers/hwmon/lm87.c
+++ b/drivers/hwmon/lm87.c
@@ -867,11 +867,11 @@ static void lm87_init_client(struct i2c_client *client)
867 lm87_write_value(client, LM87_REG_IN_MAX(0), 0xFF); 867 lm87_write_value(client, LM87_REG_IN_MAX(0), 0xFF);
868 } 868 }
869 } 869 }
870 if ((config & 0x81) != 0x01) { 870
871 /* Start monitoring */ 871 /* Make sure Start is set and INT#_Clear is clear */
872 if ((config & 0x09) != 0x01)
872 lm87_write_value(client, LM87_REG_CONFIG, 873 lm87_write_value(client, LM87_REG_CONFIG,
873 (config & 0xF7) | 0x01); 874 (config & 0x77) | 0x01);
874 }
875} 875}
876 876
877static int lm87_remove(struct i2c_client *client) 877static int lm87_remove(struct i2c_client *client)