mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-05 10:04:12 +08:00
platform/x86/drivers/acerhdf: Use module_param_cb to set/get polling interval
The module parameter can be set by using ops to get and set the values. The change will allow to check the correctness of the interval value everytime it is changed instead of checking in the get_temp function. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Acked-by: Peter Kaestle <peter@piie.net> Acked-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20201203071738.2363701-1-daniel.lezcano@linaro.org
This commit is contained in:
parent
e57eb8b505
commit
a65181c41e
@ -84,8 +84,6 @@ static struct platform_device *acerhdf_dev;
|
||||
|
||||
module_param(kernelmode, uint, 0);
|
||||
MODULE_PARM_DESC(kernelmode, "Kernel mode fan control on / off");
|
||||
module_param(interval, uint, 0600);
|
||||
MODULE_PARM_DESC(interval, "Polling interval of temperature check");
|
||||
module_param(fanon, uint, 0600);
|
||||
MODULE_PARM_DESC(fanon, "Turn the fan on above this temperature");
|
||||
module_param(fanoff, uint, 0600);
|
||||
@ -824,3 +822,11 @@ MODULE_ALIAS("dmi:*:*Acer*:pnExtensa*5420*:");
|
||||
|
||||
module_init(acerhdf_init);
|
||||
module_exit(acerhdf_exit);
|
||||
|
||||
static const struct kernel_param_ops interval_ops = {
|
||||
.set = param_set_uint,
|
||||
.get = param_get_uint,
|
||||
};
|
||||
|
||||
module_param_cb(interval, &interval_ops, &interval, 0600);
|
||||
MODULE_PARM_DESC(interval, "Polling interval of temperature check");
|
||||
|
Loading…
Reference in New Issue
Block a user