[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOMZO5AXSSkHpeuHNRQ6qkFoe2uiFLVxndz1u7_y7s9cLD9ppw@mail.gmail.com>
Date: Sat, 19 Nov 2022 19:02:34 -0300
From: Fabio Estevam <festevam@...il.com>
To: Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Abel Vesa <abelvesa@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
NXP Linux Team <linux-imx@....com>,
linux-kernel@...r.kernel.org, linux-clk@...r.kernel.org
Subject: Re: [PATCH] clk: imx8mp: register driver at arch_initcall time
On Sat, Nov 19, 2022 at 6:57 PM Rasmus Villemoes
<linux@...musvillemoes.dk> wrote:
> Sorry, I don't follow. Before this patch, the driver also implicitly had
> a module_exit() doing exactly this platform_driver_unregister(), it was
> just hidden inside the module_platform_driver() macro. And I think
> that's necessary if one wants to test that the module can be loaded and
> unloaded (I don't think it's ever useful or even possible to have it be
> a module on an actual imx8mp board).
You cannot load/unload it due to .suppress_bind_attrs = true, being passed.
> For a modular build, this patch changes nothing since all foo_initcall
> levels are translated to module_initcall for those. And when the driver
> is built-in, the __exit code, both before and after this patch, is
> discarded in the final image.
All I am suggesting is that you the patch only does:
--- a/drivers/clk/imx/clk-imx8mp.c
+++ b/drivers/clk/imx/clk-imx8mp.c
@@ -734,7 +734,19 @@ static struct platform_driver imx8mp_clk_driver = {
.of_match_table = imx8mp_clk_of_match,
},
};
-module_platform_driver(imx8mp_clk_driver);
+
+static int __init imx8mp_clk_init(void)
+{
+ return platform_driver_register(&imx8mp_clk_driver);
+}
+arch_initcall(imx8mp_clk_init);
This is the same as in drivers/pinctrl/freescale/pinctrl-imx8mm.c for example.
Powered by blists - more mailing lists