Commit 76c0295c authored by Martin Peres's avatar Martin Peres Committed by Ben Skeggs

drm/nv40/therm: reserve negative temperatures for errors

Signed-off-by: default avatarMartin Peres <martin.peres@labri.fr>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent ad40d73e
...@@ -102,6 +102,10 @@ nv40_temp_get(struct nouveau_therm *therm) ...@@ -102,6 +102,10 @@ nv40_temp_get(struct nouveau_therm *therm)
core_temp = core_temp + sensor->offset_num / sensor->offset_den; core_temp = core_temp + sensor->offset_num / sensor->offset_den;
core_temp = core_temp + sensor->offset_constant - 8; core_temp = core_temp + sensor->offset_constant - 8;
/* reserve negative temperatures for errors */
if (core_temp < 0)
core_temp = 0;
return core_temp; return core_temp;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment