drm/nv40/therm: reserve negative temperatures for errors
Signed-off-by: Martin Peres <martin.peres@labri.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
ad40d73ef5
commit
76c0295c38
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue