Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7574d7e937f81754dfd82deac24aea5880107e2d
Commit:     7574d7e937f81754dfd82deac24aea5880107e2d
Parent:     c420bc9f09a0926b708c3edb27eacba434a4f4ba
Author:     Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Sun May 27 22:17:43 2007 +0200
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun May 27 22:17:43 2007 +0200

    hwmon/ds1621: Fix swapped temperature limits
    
    The low temperature limit and the high temperature limit registers
    have been accidentally swapped, causing alarms to trigger
    when they shouldn't.
    
    Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
    Acked-by: Aurelien Jarno <[EMAIL PROTECTED]>
---
 drivers/hwmon/ds1621.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c
index c849c0c..d5ac422 100644
--- a/drivers/hwmon/ds1621.c
+++ b/drivers/hwmon/ds1621.c
@@ -53,8 +53,8 @@ MODULE_PARM_DESC(polarity, "Output's polarity: 0 = active 
high, 1 = active low")
 
 /* The DS1621 registers */
 #define DS1621_REG_TEMP                        0xAA /* word, RO */
-#define DS1621_REG_TEMP_MIN            0xA1 /* word, RW */
-#define DS1621_REG_TEMP_MAX            0xA2 /* word, RW */
+#define DS1621_REG_TEMP_MIN            0xA2 /* word, RW */
+#define DS1621_REG_TEMP_MAX            0xA1 /* word, RW */
 #define DS1621_REG_CONF                        0xAC /* byte, RW */
 #define DS1621_COM_START               0xEE /* no data */
 #define DS1621_COM_STOP                        0x22 /* no data */
@@ -328,9 +328,9 @@ static struct ds1621_data *ds1621_update_client(struct 
device *dev)
 
                /* reset alarms if necessary */
                new_conf = data->conf;
-               if (data->temp < data->temp_min)
+               if (data->temp > data->temp_min)
                        new_conf &= ~DS1621_ALARM_TEMP_LOW;
-               if (data->temp > data->temp_max)
+               if (data->temp < data->temp_max)
                        new_conf &= ~DS1621_ALARM_TEMP_HIGH;
                if (data->conf != new_conf)
                        ds1621_write_value(client, DS1621_REG_CONF,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to