lkml.org 
[lkml]   [2013]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/5 RESEND] thermal: exynos: Miscellaneous fixes to support falling threshold interrupt
From
Date
On Sun, 2013-01-06 at 15:50 -0800, Amit Daniel Kachhap wrote:
> Below fixes are done to support falling threshold interrupt,
> * Falling interrupt status macro corrected according to exynos5 data sheet.
> * The get trend function modified to calculate trip temperature correctly.
> * The clearing of interrupt status in the isr is now done after handling
> the event that caused the interrupt.
[]
> diff --git a/drivers/thermal/exynos_thermal.c b/drivers/thermal/exynos_thermal.c
[]
> @@ -373,12 +373,19 @@ static int exynos_get_temp(struct thermal_zone_device *thermal,
> static int exynos_get_trend(struct thermal_zone_device *thermal,
> int trip, enum thermal_trend *trend)
> {
> - if (thermal->temperature >= trip)
> + int ret = 0;

Unnecessary initialization

> + unsigned long trip_temp;
> +
> + ret = exynos_get_trip_temp(thermal, trip, &trip_temp);
> + if (ret < 0)
> + return ret;
> +
> + if (thermal->temperature >= trip_temp)
> *trend = THERMAL_TREND_RAISING;
> else
> *trend = THERMAL_TREND_DROPPING;

THERMAL_TREND_STABLE ?

>
> - return 0;
> + return ret;

return 0 is clearer.



\
 
 \ /
  Last update: 2013-01-07 01:21    [W:0.074 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site