]> err.no Git - linux-2.6/commitdiff
hwmon: fix dme1737 temp fault attribute
authorJuerg Haefliger <juergh@gmail.com>
Fri, 20 Jul 2007 21:16:47 +0000 (14:16 -0700)
committerMark M. Hoffman <mhoffman@lightlink.com>
Tue, 31 Jul 2007 01:07:23 +0000 (21:07 -0400)
Fix temp?_fault attribute. The temp was incorrectly compared against
0x0800 rather than 0x8000. Only the upper 8 bits are compared as the
datasheet doesn't specify what happens to the lower bits in case of a
diode fault.

Signed-off-by: Juerg Haefliger <juergh at gmail.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark M. Hoffman <mhoffman@lightlink.com>
drivers/hwmon/dme1737.c

index be3aaa5d0b917414648dfb7cb0f38b54aea1d073..e9cbc727664d4221422be223c3c8ca082231ce67 100644 (file)
@@ -750,7 +750,7 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *attr,
                res = (data->alarms >> DME1737_BIT_ALARM_TEMP[ix]) & 0x01;
                break;
        case SYS_TEMP_FAULT:
-               res = (data->temp[ix] == 0x0800);
+               res = (((u16)data->temp[ix] & 0xff00) == 0x8000);
                break;
        default:
                res = 0;