summaryrefslogtreecommitdiff
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2010-02-17 00:55:51 +0300
committerLen Brown <len.brown@intel.com>2010-02-19 09:48:48 +0300
commit8b7ef6d8f16274da42344cd50746ddb1c93c25ea (patch)
treeddb90374556693b5173b2610821e6bdd60845af8 /drivers/acpi/thermal.c
parentf8b55f251012e104093e105483c45c5d85ad3040 (diff)
downloadlinux-8b7ef6d8f16274da42344cd50746ddb1c93c25ea.tar.xz
ACPI thermal: Check for thermal zone requirement
ACPI spec says (11.5 Thermal Zone Interface Requirements): A thermal zone must contain at least one trip point (critical, near critical, active, or passive) Check this once at init time. Signed-off-by: Thomas Renninger <trenn@suse.de> Tested-by: clarkt@cnsp.com Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r--drivers/acpi/thermal.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 9073ada88835..e9f28e075cf8 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -575,7 +575,23 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
{
- return acpi_thermal_trips_update(tz, ACPI_TRIPS_INIT);
+ int i, valid, ret = acpi_thermal_trips_update(tz, ACPI_TRIPS_INIT);
+
+ if (ret)
+ return ret;
+
+ valid = tz->trips.critical.flags.valid |
+ tz->trips.hot.flags.valid |
+ tz->trips.passive.flags.valid;
+
+ for (i = 0; i < ACPI_THERMAL_MAX_ACTIVE; i++)
+ valid |= tz->trips.active[i].flags.valid;
+
+ if (!valid) {
+ printk(KERN_WARNING FW_BUG "No valid trip found\n");
+ return -ENODEV;
+ }
+ return 0;
}
static void acpi_thermal_check(void *data)