Re: [PATCH] spi: fix controller registration API inconsistency
From: Mark Brown
Date: Wed May 20 2026 - 09:41:25 EST
On Tue, May 12, 2026 at 04:01:31PM +0200, Johan Hovold wrote:
> With most drivers converted to use managed allocation in preparation for
> fixing the API, the remaining 16 drivers can be converted in one
> tree-wide change. Ten of those drivers use the bitbang interface and can
> be converted by simply removing the extra reference already taken by
> spi_bitbang_start(). [4]
> Fix the API inconsistency by no longer dropping a reference when
> deregistering non-devres allocated controllers.
> - *
> - * On success, this routine will take a reference to the controller. The caller
> - * is responsible for calling spi_bitbang_stop() to decrement the reference and
> - * spi_controller_put() as counterpart of spi_alloc_host() to prevent a memory
> - * leak.
> */
The xilinx and xtensa-xtfpga drivers use devm_spi_alloc_host() and
spi_bitbang_start() but still call spi_controller_put() in their remove
paths.
Attachment:
signature.asc
Description: PGP signature