]> Git Repo - J-linux.git/commitdiff
thermal/drivers/acerhdf: Make interval setting only at module load time
authorDaniel Lezcano <[email protected]>
Wed, 1 Mar 2023 20:14:45 +0000 (21:14 +0100)
committerRafael J. Wysocki <[email protected]>
Fri, 3 Mar 2023 19:45:03 +0000 (20:45 +0100)
The thermal zone device structure is in the process of being private
to the thermal framework core code. This driver is directly accessing
and changing the monitoring polling rate.

After discussing with the maintainers of this driver, having the
polling interval at module loading time is enough for their purpose.

Change the code to take into account the interval when the module is
loaded but restrict the permissions so the value can not be changed
afterwards.

Signed-off-by: Daniel Lezcano <[email protected]>
Acked-by: Peter Kaestle <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
drivers/platform/x86/acerhdf.c

index a48638ad2a8aa17066962ede16606229267688ba..50cdf70ade7fbf283cffd4a104110a20ed0b005a 100644 (file)
@@ -79,7 +79,6 @@ static unsigned int list_supported;
 static unsigned int fanstate = ACERHDF_FAN_AUTO;
 static char force_bios[16];
 static char force_product[16];
-static unsigned int prev_interval;
 static struct thermal_zone_device *thz_dev;
 static struct thermal_cooling_device *cl_dev;
 static struct platform_device *acerhdf_dev;
@@ -346,20 +345,15 @@ static void acerhdf_check_param(struct thermal_zone_device *thermal)
        trips[0].temperature = fanon;
        trips[0].hysteresis  = fanon - fanoff;
 
-       if (kernelmode && prev_interval != interval) {
+       if (kernelmode) {
                if (interval > ACERHDF_MAX_INTERVAL) {
                        pr_err("interval too high, set to %d\n",
                               ACERHDF_MAX_INTERVAL);
                        interval = ACERHDF_MAX_INTERVAL;
                }
+
                if (verbose)
                        pr_notice("interval changed to: %d\n", interval);
-
-               if (thermal)
-                       thermal->polling_delay_jiffies =
-                               round_jiffies(msecs_to_jiffies(interval * 1000));
-
-               prev_interval = interval;
        }
 }
 
@@ -801,5 +795,5 @@ static const struct kernel_param_ops interval_ops = {
        .get = param_get_uint,
 };
 
-module_param_cb(interval, &interval_ops, &interval, 0600);
+module_param_cb(interval, &interval_ops, &interval, 0000);
 MODULE_PARM_DESC(interval, "Polling interval of temperature check");
This page took 0.055689 seconds and 4 git commands to generate.