hwmon: fix temp fault in dme1737 driver
Subsystems (2)
PATCH 1/1 hwmon: fix temp fault in dme1737 driver
Fix temp?_fault attribute. The temp was incorrectly compared against 0x0800 rather than 0x8000.
Fix temp?_fault attribute. The temp was incorrectly compared against 0x0800 rather than 0x8000.
---
drivers/hwmon/dme1737.c +1 -1
@@ -750,7 +750,7 @@ res = (data->alarms >>DME1737_BIT_ALARM_TEMP [ix]) &0x01 ;break ;case SYS_TEMP_FAULT : - res = (data->temp[ix] ==0x0800 ); + res = (data->temp[ix] == (s16 )0x8000 );break ;default : res =0 ;
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Juerg,
Quoted 4 lines · Juerg Haefliger
Fix temp?_fault attribute. The temp was incorrectly compared against
0x0800rather than0x8000.Signed-off-by Juerg Haefliger <juergh at gmail.com>
Have you verified that this works as intended in practice? The datasheet says that "a diode fault condition forces the diode reading register to a value of 80h", which leaves some doubt on whether the 4 LSBs, which live in a different register, are set to 0 as well or not. So I wonder if:
res = ((data->temp[ix] & 0xff00) = (s16)0x8000);
wouldn't be a better test.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Jean,
Quoted 14 lines
Hi Juerg,
Quoted 4 lines · Juerg Haefliger
Fix temp?_fault attribute. The temp was incorrectly compared against
0x0800rather than0x8000.Signed-off-by Juerg Haefliger <juergh at gmail.com>Have you verified that this works as intended in practice? The datasheet says that "a diode fault condition forces the diode reading register to a value of 80h", which leaves some doubt on whether the 4 LSBs, which live in a different register, are set to 0 as well or not. So I wonder if:
Quoted 3 lines
res = ((data->temp[ix] & 0xff00) = (s16)0x8000);wouldn't be a better test.
Yes I tested it but you have a valid point. I like your solution better, it's safer.
...juerg
Quoted 3 lines
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors