Skip to content

Commit

Permalink
hwmon: fix dme1737 temp fault attribute
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Juerg Haefliger authored and Mark M. Hoffman committed Jul 31, 2007
1 parent d054612 commit c0f3140
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/dme1737.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c0f3140

Please sign in to comment.