Skip to content

Commit

Permalink
drm/nv40/therm: reserve negative temperatures for errors
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Martin Peres authored and Ben Skeggs committed Mar 18, 2013
1 parent ad40d73 commit 76c0295
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_constant - 8;

/* reserve negative temperatures for errors */
if (core_temp < 0)
core_temp = 0;

return core_temp;
}

Expand Down

0 comments on commit 76c0295

Please sign in to comment.