diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c index 19fc8ff2225c..b6aa6e5514f4 100644 --- a/drivers/platform/x86/acerhdf.c +++ b/drivers/platform/x86/acerhdf.c @@ -334,7 +334,10 @@ static void acerhdf_check_param(struct thermal_zone_device *thermal) } if (verbose) pr_notice("interval changed to: %d\n", interval); - thermal->polling_delay = interval*1000; + + if (thermal) + thermal->polling_delay = interval*1000; + prev_interval = interval; } } @@ -349,8 +352,6 @@ static int acerhdf_get_ec_temp(struct thermal_zone_device *thermal, int *t) { int temp, err = 0; - acerhdf_check_param(thermal); - err = acerhdf_get_temp(&temp); if (err) return err; @@ -823,8 +824,21 @@ MODULE_ALIAS("dmi:*:*Acer*:pnExtensa*5420*:"); module_init(acerhdf_init); module_exit(acerhdf_exit); +static int interval_set_uint(const char *val, const struct kernel_param *kp) +{ + int ret; + + ret = param_set_uint(val, kp); + if (ret) + return ret; + + acerhdf_check_param(thz_dev); + + return 0; +} + static const struct kernel_param_ops interval_ops = { - .set = param_set_uint, + .set = interval_set_uint, .get = param_get_uint, };