Re: spi: imx: Use devm_clk_get_enabled() calls in spi_imx_probe()

From: Andy Shevchenko

Date: Mon Nov 23 2026 - 13:50:10 EST


On Mon, Nov 23, 2026 at 07:24:21PM +0100, Markus Elfring wrote:
> >> * Reuse existing functionality from devm_clk_get_enabled() instead of
> >> keeping duplicate source code.
> >>
> >> * Delete clk_disable_unprepare() calls on error handling paths.
> >>
> >> * Omit the label “out_put_per”.
> >>
> >> This issue was detected by using the Coccinelle software.
> >
> > This now messes up with the PM callbacks at remove stage.
> > It's not trivial how to make it correct.
> Is there a need to adjust and extend devres programming interfaces any more?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/driver-api/driver-model/devres.rst?h=v7.4-rc4#n242

I guess you did get my point. You can't simply do what you have done in this
patch, because the devm*() will do something with clock reference counting on
remove stage _after_ the driver.

NAK to this change.

--
With Best Regards,
Andy Shevchenko