[PATCH 1/2] lm87: Fix masking of config register in lm87_init_client()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



lm87_init_client() does:

	if ((config & 0x81) != 0x01) {
		/* Start monitoring */
		lm87_write_value(client, LM87_REG_CONFIG,
				 (config & 0xF7) | 0x01);
	}

This means that if the Start bit is clear or the Initialization bit is
set we set the Start bit and clear the INT#_Clear bit.  I think this
should actually clear the Initialization bit and that 0xF7 is a typo
for 0x7F.

Signed-off-by: Ben Hutchings <bhutchings at solarflare.com>
---
 drivers/hwmon/lm87.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/hwmon/lm87.c b/drivers/hwmon/lm87.c
index 21970f0..ddad6fc 100644
--- a/drivers/hwmon/lm87.c
+++ b/drivers/hwmon/lm87.c
@@ -870,7 +870,7 @@ static void lm87_init_client(struct i2c_client *client)
 	if ((config & 0x81) != 0x01) {
 		/* Start monitoring */
 		lm87_write_value(client, LM87_REG_CONFIG,
-				 (config & 0xF7) | 0x01);
+				 (config & ~0x80) | 0x01);
 	}
 }
 
-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux