summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/intel/intel_pch_thermal.c2
-rw-r--r--drivers/thermal/thermal_acpi.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/thermal/intel/intel_pch_thermal.c b/drivers/thermal/intel/intel_pch_thermal.c
index cc4e9d28496b..45a9ea86907e 100644
--- a/drivers/thermal/intel/intel_pch_thermal.c
+++ b/drivers/thermal/intel/intel_pch_thermal.c
@@ -107,7 +107,7 @@ static void pch_wpt_add_acpi_psv_trip(struct pch_thermal_device *ptd,
return;
ret = thermal_acpi_trip_passive(adev, &ptd->trips[*nr_trips]);
- if (ret)
+ if (ret || ptd->trips[*nr_trips].temperature <= 0)
return;
++(*nr_trips);
diff --git a/drivers/thermal/thermal_acpi.c b/drivers/thermal/thermal_acpi.c
index f65281ca3ed0..671f774a7621 100644
--- a/drivers/thermal/thermal_acpi.c
+++ b/drivers/thermal/thermal_acpi.c
@@ -64,13 +64,14 @@ static int thermal_acpi_trip_init(struct acpi_device *adev,
return -ENODATA;
}
- if (temp < TEMP_MIN_DECIK || temp >= TEMP_MAX_DECIK) {
+ if (temp >= TEMP_MIN_DECIK && temp <= TEMP_MAX_DECIK) {
+ trip->temperature = deci_kelvin_to_millicelsius(temp);
+ } else {
acpi_handle_debug(adev->handle, "%s result %llu out of range\n",
obj_name, temp);
- return -ENODATA;
+ trip->temperature = THERMAL_TEMP_INVALID;
}
- trip->temperature = deci_kelvin_to_millicelsius(temp);
trip->hysteresis = 0;
trip->type = type;