mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] platform/x86/drivers/acerhdf: Use module_param_cb to set/get polling interval
@ 2020-12-02 22:22 Daniel Lezcano
  2020-12-02 22:22 ` [PATCH 2/2] platform/x86/drivers/acerhdf: Check the interval value when it is set Daniel Lezcano
  2020-12-02 22:32 ` Peter Kästle
  0 siblings, 2 replies; 4+ messages in thread
From: Daniel Lezcano @ 2020-12-02 22:22 UTC (permalink / raw)
  To: daniel.lezcano
  Cc: Peter Kaestle, Hans de Goede, Mark Gross,
	open list:ACER ASPIRE ONE TEMPERATURE AND FAN DRIVER, open list

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>
---
 drivers/platform/x86/acerhdf.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index 44b6bfbd32df..19fc8ff2225c 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -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");
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-03  1:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-02 22:22 [PATCH 1/2] platform/x86/drivers/acerhdf: Use module_param_cb to set/get polling interval Daniel Lezcano
2020-12-02 22:22 ` [PATCH 2/2] platform/x86/drivers/acerhdf: Check the interval value when it is set Daniel Lezcano
2020-12-03  1:08   ` kernel test robot
2020-12-02 22:32 ` Peter Kästle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®