From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Zhang Jianhua <chris.zjh@huawei.com>
Cc: a.zummo@towertech.it, linux-rtc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rtc: fsl-ftm-alarm: Use module_init and add module_exit
Date: Fri, 26 Aug 2022 09:22:57 +0200 [thread overview]
Message-ID: <Ywh00crgSilSfZnC@mail.local> (raw)
In-Reply-To: <20220826070017.2340617-1-chris.zjh@huawei.com>
On 26/08/2022 15:00:17+0800, Zhang Jianhua wrote:
> - Use module_init instead of device_initcall.
> - Add a function for module_exit to unregister driver.
>
I can see what you are doing but this doesn't explain why. Also, was
this tested on any actual hardware?
> Signed-off-by: Zhang Jianhua <chris.zjh@huawei.com>
> ---
> drivers/rtc/rtc-fsl-ftm-alarm.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-fsl-ftm-alarm.c b/drivers/rtc/rtc-fsl-ftm-alarm.c
> index c0df49fb978c..28bdc6c97b64 100644
> --- a/drivers/rtc/rtc-fsl-ftm-alarm.c
> +++ b/drivers/rtc/rtc-fsl-ftm-alarm.c
> @@ -332,7 +332,13 @@ static int __init ftm_alarm_init(void)
> return platform_driver_register(&ftm_rtc_driver);
> }
>
> -device_initcall(ftm_alarm_init);
> +static void __exit ftm_alarm_exit(void)
> +{
> + platform_driver_unregister(&ftm_rtc_driver);
> +}
> +
> +module_init(ftm_alarm_init)
> +module_exit(ftm_alarm_exit)
>
> MODULE_DESCRIPTION("NXP/Freescale FlexTimer alarm driver");
> MODULE_AUTHOR("Biwen Li <biwen.li@nxp.com>");
> --
> 2.31.0
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2022-08-26 7:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-26 7:00 [PATCH] rtc: fsl-ftm-alarm: Use module_init and add module_exit Zhang Jianhua
2022-08-26 7:22 ` Alexandre Belloni [this message]
2022-08-26 7:45 ` zhangjianhua (E)
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=Ywh00crgSilSfZnC@mail.local \
--to=alexandre.belloni@bootlin.com \
--cc=a.zummo@towertech.it \
--cc=chris.zjh@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@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