From: "Peter Kästle" <peter@piie.net>
To: "Daniel Lezcano" <daniel.lezcano@linaro.org>,
hdegoede@redhat.com, mgross@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] platform/x86/drivers/acerhdf: Use module_param_cb to set/get polling interval
Date: Thu, 03 Dec 2020 21:17:58 +0000 [thread overview]
Message-ID: <973e8be431d60986e8257320d9acf997@piie.net> (raw)
In-Reply-To: <20201203071738.2363701-1-daniel.lezcano@linaro.org>
3. Dezember 2020 08:17, "Daniel Lezcano" <daniel.lezcano@linaro.org> schrieb:
> 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>
> ---
> 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
next prev parent reply other threads:[~2020-12-03 21:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 7:17 Daniel Lezcano
2020-12-03 7:17 ` [PATCH v2 2/2] platform/x86/drivers/acerhdf: Check the interval value when it is set Daniel Lezcano
2020-12-03 21:17 ` Peter Kästle [this message]
2020-12-03 21:22 ` Peter Kästle
2020-12-04 11:43 ` Daniel Lezcano
2020-12-07 14:54 ` Hans de Goede
2020-12-07 15:59 ` Daniel Lezcano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=973e8be431d60986e8257320d9acf997@piie.net \
--to=peter@piie.net \
--cc=daniel.lezcano@linaro.org \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mgross@linux.intel.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®