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

From: Andy Shevchenko

Date: Thu Mar 26 2026 - 05:34:08 EST


On Wed, Mar 25, 2026 at 04:03:43PM +0100, Johan Hovold wrote:
> 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.

Ouch!

> 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.

I see, yeah, it's better to do so.

--
With Best Regards,
Andy Shevchenko