diff options
| author | Johan Hovold <johan@kernel.org> | 2026-03-12 16:18:17 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-03-16 18:36:06 +0000 |
| commit | 3f174274d2249342df00d43fdef25511c3d3565a (patch) | |
| tree | 95a1613446327689a26a5daf9a41243f06ecb202 | |
| parent | edc463d72d697ff22da8ba96c0fcb25f3586d9a2 (diff) | |
| download | linux-3f174274d2249342df00d43fdef25511c3d3565a.tar.gz linux-3f174274d2249342df00d43fdef25511c3d3565a.zip | |
spi: fix misleading controller deregistration kernel-doc
The controller reference count is not decremented on deregistration if
the controller has been allocated using devm_spi_alloc_host/target().
Amend the kernel-doc for devm_spi_register_controller() and
spi_unregister_controller() so that it reflects this (more recent)
behaviour.
Fixes: 5e844cc37a5c ("spi: Introduce device-managed SPI controller allocation")
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260312151817.32100-6-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | drivers/spi/spi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 34aca18a96d8..b5e2f1e1a89e 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -3523,7 +3523,8 @@ static void devm_spi_unregister_controller(void *ctlr) * Context: can sleep * * Register a SPI device as with spi_register_controller() which will - * automatically be unregistered and freed. + * automatically be unregistered (and freed unless it has been allocated using + * devm_spi_alloc_host/target()). * * Return: zero on success, else a negative error code. */ @@ -3557,7 +3558,8 @@ static int __unregister(struct device *dev, void *null) * * This must be called from context that can sleep. * - * Note that this function also drops a reference to the controller. + * Note that this function also drops a reference to the controller unless it + * has been allocated using devm_spi_alloc_host/target(). */ void spi_unregister_controller(struct spi_controller *ctlr) { |
