From: "Danilo Krummrich" <dakr@kernel.org>
To: "Peng Fan" <peng.fan@oss.nxp.com>
Cc: <abelvesa@kernel.org>, <peng.fan@nxp.com>,
<daniel.baluta@oss.nxp.com>, <mturquette@baylibre.com>,
<sboyd@kernel.org>, <Frank.Li@nxp.com>, <s.hauer@pengutronix.de>,
<kernel@pengutronix.de>, <festevam@gmail.com>,
<gregkh@linuxfoundation.org>, <rafael@kernel.org>,
<hanguidong02@gmail.com>, <driver-core@lists.linux.dev>,
<linux-kernel@vger.kernel.org>, <linux-clk@vger.kernel.org>,
<imx@lists.linux.dev>, <linux-arm-kernel@lists.infradead.org>,
"Alexander Stein" <alexander.stein@ew.tq-group.com>
Subject: Re: [PATCH v2] clk: scu/imx8qxp: do not register driver in probe()
Date: Wed, 25 Feb 2026 12:31:57 +0100 [thread overview]
Message-ID: <DGO0COF2NCJ0.GFYKM4L9KTP0@kernel.org> (raw)
In-Reply-To: <aZ6vyQw5a5LhSCaT@shlinux89>
On Wed Feb 25, 2026 at 9:16 AM CET, Peng Fan wrote:
>>diff --git a/drivers/clk/imx/clk-imx8qxp.c b/drivers/clk/imx/clk-imx8qxp.c
>>index 3ae162625bb1..c781425a005e 100644
>>--- a/drivers/clk/imx/clk-imx8qxp.c
>>+++ b/drivers/clk/imx/clk-imx8qxp.c
>>@@ -346,7 +346,29 @@ static struct platform_driver imx8qxp_clk_driver = {
>> },
>> .probe = imx8qxp_clk_probe,
>> };
>>-module_platform_driver(imx8qxp_clk_driver);
>>+
>>+static int __init imx8qxp_clk_init(void)
>>+{
>>+ int ret;
>>+
>>+ ret = platform_driver_register(&imx8qxp_clk_driver);
>>+ if (ret)
>>+ return ret;
>>+
>>+ ret = imx_clk_scu_module_init();
>>+ if (ret)
>>+ platform_driver_unregister(&imx8qxp_clk_driver);
>>+
>>+ return ret;
>>+}
>>+module_init(imx8qxp_clk_init);
>>+
>>+static void __exit imx8qxp_clk_exit(void)
>>+{
>>+ imx_clk_scu_module_exit();
>>+ platform_driver_unregister(&imx8qxp_clk_driver);
>>+}
>>+module_exit(imx8qxp_clk_exit);
>
> The clk driver is critical for the system to work, removing this driver will
> make the system not work properly I think, so it may not make too much
> value to add an exit function here.
The exit function was there before, just hidden by the module_platform_driver()
macro.
If a driver can be built as module, then we have to unregister the driver, when
the module is unloaded.
If this driver should always be builtin, that is a separate change, independent
from this fix.
next prev parent reply other threads:[~2026-02-25 11:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-12 23:58 [PATCH v2] clk: scu/imx8qxp: do not register driver in probe() Danilo Krummrich
2026-02-13 8:58 ` Daniel Baluta
2026-02-23 20:21 ` Danilo Krummrich
2026-02-24 9:57 ` Abel Vesa
2026-02-24 12:04 ` Danilo Krummrich
2026-02-25 8:16 ` Peng Fan
2026-02-25 11:31 ` Danilo Krummrich [this message]
2026-02-27 0:55 ` Peng Fan
2026-03-18 15:39 ` Abel Vesa
2026-03-18 15:42 ` Danilo Krummrich
2026-03-18 16:37 ` Abel Vesa
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=DGO0COF2NCJ0.GFYKM4L9KTP0@kernel.org \
--to=dakr@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=abelvesa@kernel.org \
--cc=alexander.stein@ew.tq-group.com \
--cc=daniel.baluta@oss.nxp.com \
--cc=driver-core@lists.linux.dev \
--cc=festevam@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hanguidong02@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=rafael@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=sboyd@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.