aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r--drivers/acpi/thermal.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index fb46070c66d8..4ba273f49d87 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -172,7 +172,6 @@ struct acpi_thermal {
struct acpi_thermal_trips trips;
struct acpi_handle_list devices;
struct thermal_zone_device *thermal_zone;
- enum thermal_device_mode mode;
int kelvin_offset; /* in millidegrees */
struct work_struct thermal_check_work;
};
@@ -500,7 +499,7 @@ static void acpi_thermal_check(void *data)
{
struct acpi_thermal *tz = data;
- if (tz->mode != THERMAL_DEVICE_ENABLED)
+ if (tz->thermal_zone->mode != THERMAL_DEVICE_ENABLED)
return;
thermal_zone_device_update(tz->thermal_zone,
@@ -529,12 +528,7 @@ static int thermal_get_temp(struct thermal_zone_device *thermal, int *temp)
static int thermal_get_mode(struct thermal_zone_device *thermal,
enum thermal_device_mode *mode)
{
- struct acpi_thermal *tz = thermal->devdata;
-
- if (!tz)
- return -EINVAL;
-
- *mode = tz->mode;
+ *mode = thermal->mode;
return 0;
}
@@ -556,11 +550,11 @@ static int thermal_set_mode(struct thermal_zone_device *thermal,
if (mode == THERMAL_DEVICE_DISABLED)
pr_warn("thermal zone will be disabled\n");
- if (mode != tz->mode) {
- tz->mode = mode;
+ if (mode != tz->thermal_zone->mode) {
+ tz->thermal_zone->mode = mode;
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"%s kernel ACPI thermal control\n",
- tz->mode == THERMAL_DEVICE_ENABLED ?
+ tz->thermal_zone->mode == THERMAL_DEVICE_ENABLED ?
"Enable" : "Disable"));
acpi_thermal_check(tz);
}
@@ -912,7 +906,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
goto remove_dev_link;
}
- tz->mode = THERMAL_DEVICE_ENABLED;
+ tz->thermal_zone->mode = THERMAL_DEVICE_ENABLED;
dev_info(&tz->device->dev, "registered as thermal_zone%d\n",
tz->thermal_zone->id);