summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/gov_bang_bang.c2
-rw-r--r--drivers/thermal/gov_fair_share.c16
-rw-r--r--drivers/thermal/gov_power_allocator.c2
-rw-r--r--drivers/thermal/thermal_sysfs.c2
4 files changed, 13 insertions, 9 deletions
diff --git a/drivers/thermal/gov_bang_bang.c b/drivers/thermal/gov_bang_bang.c
index 6ddf0accdc98..c3b2943a2db8 100644
--- a/drivers/thermal/gov_bang_bang.c
+++ b/drivers/thermal/gov_bang_bang.c
@@ -49,7 +49,7 @@ static int thermal_zone_trip_update(struct thermal_zone_device *tz,
if (instance->target == 0 && tz->temperature >= trip->temperature)
instance->target = 1;
else if (instance->target == 1 &&
- tz->temperature <= trip->temperature - trip->hysteresis)
+ tz->temperature < trip->temperature - trip->hysteresis)
instance->target = 0;
dev_dbg(&instance->cdev->device, "target=%d\n",
diff --git a/drivers/thermal/gov_fair_share.c b/drivers/thermal/gov_fair_share.c
index 538abb7de4e2..4da25a0009d7 100644
--- a/drivers/thermal/gov_fair_share.c
+++ b/drivers/thermal/gov_fair_share.c
@@ -18,22 +18,24 @@
static int get_trip_level(struct thermal_zone_device *tz)
{
const struct thermal_trip *trip, *level_trip = NULL;
- int trip_level;
+ int trip_level = -1;
for_each_trip(tz, trip) {
if (trip->temperature >= tz->temperature)
- break;
+ continue;
+
+ trip_level++;
- level_trip = trip;
+ if (!level_trip || trip->temperature > level_trip->temperature)
+ level_trip = trip;
}
/* Bail out if the temperature is not greater than any trips. */
- if (!level_trip)
+ if (trip_level < 0)
return 0;
- trip_level = thermal_zone_trip_id(tz, level_trip);
-
- trace_thermal_zone_trip(tz, trip_level, level_trip->type);
+ trace_thermal_zone_trip(tz, thermal_zone_trip_id(tz, level_trip),
+ level_trip->type);
return trip_level;
}
diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c
index 81e061f183ad..1b17dc4c219c 100644
--- a/drivers/thermal/gov_power_allocator.c
+++ b/drivers/thermal/gov_power_allocator.c
@@ -711,6 +711,8 @@ static int power_allocator_bind(struct thermal_zone_device *tz)
if (!tz->tzp->sustainable_power)
dev_warn(&tz->device, "power_allocator: sustainable_power will be estimated\n");
+ else
+ params->sustainable_power = tz->tzp->sustainable_power;
estimate_pid_constants(tz, tz->tzp->sustainable_power,
params->trip_switch_on,
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index f4033865b093..d55f9303afb5 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -136,7 +136,7 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr,
unlock:
mutex_unlock(&tz->lock);
-
+
return ret ? ret : count;
}