hwmon/via686a: Temperature interrupt configuration fix
authorJean Delvare <khali@linux-fr.org>
Sat, 9 Jun 2007 14:11:16 +0000 (10:11 -0400)
committerMark M. Hoffman <mhoffman@lightlink.com>
Thu, 19 Jul 2007 18:22:13 +0000 (14:22 -0400)
Fix the writing of the temperature interrupt configuration.
The old code was working only by accident.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/via686a.c

index 9a440c8cc5203c3fc4b6ac5646d0d980230284a5..a25b0542649c3fcd9bc50c89f8933533ee5da965 100644 (file)
@@ -740,9 +740,10 @@ static void via686a_init_client(struct i2c_client *client)
        via686a_write_value(client, VIA686A_REG_CONFIG, (reg|0x01)&0x7F);
 
        /* Configure temp interrupt mode for continuous-interrupt operation */
+       reg = via686a_read_value(client, VIA686A_REG_TEMP_MODE);
        via686a_write_value(client, VIA686A_REG_TEMP_MODE,
-                           via686a_read_value(client, VIA686A_REG_TEMP_MODE) &
-                           !(VIA686A_TEMP_MODE_MASK | VIA686A_TEMP_MODE_CONTINUOUS));
+                           (reg & ~VIA686A_TEMP_MODE_MASK)
+                           | VIA686A_TEMP_MODE_CONTINUOUS);
 }
 
 static struct via686a_data *via686a_update_device(struct device *dev)