From: Martin Peres Date: Fri, 15 Mar 2013 01:09:20 +0000 (+0100) Subject: drm/nv40/therm: reserve negative temperatures for errors X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=76c0295c389ad9ba19b668b5974cdd90eb95788e;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git drm/nv40/therm: reserve negative temperatures for errors Signed-off-by: Martin Peres Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c index c526d536409f..a70d1b7e397b 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c +++ b/drivers/gpu/drm/nouveau/core/subdev/therm/nv40.c @@ -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; }