Skip to content

Commit

Permalink
hwmon: (lm87) Fix masking of config register in lm87_init_client()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Hutchings authored and Jean Delvare committed Oct 17, 2008
1 parent 4b4e7a7 commit 49ae6cc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/hwmon/lm87.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,11 +867,11 @@ static void lm87_init_client(struct i2c_client *client)
lm87_write_value(client, LM87_REG_IN_MAX(0), 0xFF);
}
}
if ((config & 0x81) != 0x01) {
/* Start monitoring */

/* Make sure Start is set and INT#_Clear is clear */
if ((config & 0x09) != 0x01)
lm87_write_value(client, LM87_REG_CONFIG,
(config & 0xF7) | 0x01);
}
(config & 0x77) | 0x01);
}

static int lm87_remove(struct i2c_client *client)
Expand Down

0 comments on commit 49ae6cc

Please sign in to comment.