On Tue, Dec 17, 2024 at 03:31:33PM +0800, Ma Ke wrote:
Once device_add() failed, we should call put_device() to decrement reference count for cleanup. Or it could cause memory leak.
Found by code review.
This isn't clear to me, spi_register_controller() is analogous to device_add() and __spi_alloc_controller() is analogous to (and wraps) device_initialize() so I'd expect the _put() to be done by the caller calling spi_controller_put() either directly or more usually via devm.