summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/acerhdf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/acerhdf.c')
-rw-r--r--drivers/platform/x86/acerhdf.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index 58c4e1caaa09..8fe0ecb6a626 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -397,19 +397,16 @@ static inline void acerhdf_revert_to_bios_mode(void)
{
acerhdf_change_fanstate(ACERHDF_FAN_AUTO);
kernelmode = 0;
- if (thz_dev) {
- thz_dev->mode = THERMAL_DEVICE_DISABLED;
+ if (thz_dev)
thz_dev->polling_delay = 0;
- }
+
pr_notice("kernel mode fan control OFF\n");
}
static inline void acerhdf_enable_kernelmode(void)
{
kernelmode = 1;
- thz_dev->mode = THERMAL_DEVICE_ENABLED;
thz_dev->polling_delay = interval*1000;
- thermal_zone_device_update(thz_dev, THERMAL_EVENT_UNSPECIFIED);
pr_notice("kernel mode fan control ON\n");
}
@@ -723,6 +720,8 @@ static void acerhdf_unregister_platform(void)
static int __init acerhdf_register_thermal(void)
{
+ int ret;
+
cl_dev = thermal_cooling_device_register("acerhdf-fan", NULL,
&acerhdf_cooling_ops);
@@ -736,8 +735,12 @@ static int __init acerhdf_register_thermal(void)
if (IS_ERR(thz_dev))
return -EINVAL;
- thz_dev->mode = kernelmode ?
- THERMAL_DEVICE_ENABLED : THERMAL_DEVICE_DISABLED;
+ if (kernelmode)
+ ret = thermal_zone_device_enable(thz_dev);
+ else
+ ret = thermal_zone_device_disable(thz_dev);
+ if (ret)
+ return ret;
if (strcmp(thz_dev->governor->name,
acerhdf_zone_params.governor_name)) {