Re: [PATCH] clk: scu/imx8qxp: do not register driver in probe()

From: Daniel Baluta

Date: Thu Feb 12 2026 - 14:43:38 EST


On Thu, Feb 12, 2026 at 7:22 PM Danilo Krummrich <dakr@xxxxxxxxxx> wrote:
>
> On Wed Feb 11, 2026 at 3:59 PM CET, Daniel Baluta wrote:
> > On 2/11/26 16:43, Alexander Stein wrote:
> >> Am Mittwoch, 11. Februar 2026, 15:23:16 CET schrieb Danilo Krummrich:
> >>> +{
> >>> + 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;
> >>>
> > Also, because the logical flow is that CLK driver is uing SCU for calls I would first call
> > imx_clk_scu_module_init and then register the imx8qxp_clk driver.
> >
> > But there is no functionality issues your your approach too, just a better logical flow.
>
> I now remember why I kept it this way around. If we swap it we have to call
> imx_clk_scu_module_exit() in the unwind path of imx8qxp_clk_init().
> Consequently, we'd have to drop __exit from imx_clk_scu_module_exit().
>
> Please let me know what you prefer.

I see. I prefer your initial implementation then maybe with an
explanation in the commit message.