Re: [PATCH v1 1/1] spi: Simplify devm_spi_*_controller()

From: Johan Hovold

Date: Wed Mar 25 2026 - 11:56:44 EST


On Wed, Mar 25, 2026 at 11:54:34AM +0200, Andy Shevchenko wrote:
> On Tue, Mar 24, 2026 at 10:55:48PM +0800, Felix Gu wrote:

> You mean buggy driver? Any real example of the use case?
>
> In the 5. you implied something like
>
> ret = spi_alloc_host();
> ...
> ret = devm_spi_register_controller()
>
> ?

We have some 50 spi driver using a non-managed controller allocation
with managed registration. This was the only way to use these interfaces
before managed allocation was added much later.

> But this is against the rule how devm must be used.

SPI is "special"... But yeah, we should eventually fix the API to avoid
inconsistencies like this.

Johan