diff options
author | Mark Brown <broonie@kernel.org> | 2021-11-15 16:25:22 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-11-15 16:25:22 +0300 |
commit | 642fc4fa0487dd76b9c840e217c2269d352bed41 (patch) | |
tree | b85c3eaf0bc3c58a9641fca213a6afe19d0ae30b /drivers/spi/spi.c | |
parent | fa55b7dcdc43c1aa1ba12bca9d2dd4318c2a0dbf (diff) | |
parent | 6c53b45c71b4920b5e62f0ea8079a1da382b9434 (diff) | |
download | linux-642fc4fa0487dd76b9c840e217c2269d352bed41.tar.xz |
Merge existing fixes from spi/for-5.16 into new branch
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r-- | drivers/spi/spi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index b23e675953e1..fdd530b150a7 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -3099,12 +3099,6 @@ void spi_unregister_controller(struct spi_controller *ctlr) device_del(&ctlr->dev); - /* Release the last reference on the controller if its driver - * has not yet been converted to devm_spi_alloc_master/slave(). - */ - if (!ctlr->devm_allocated) - put_device(&ctlr->dev); - /* free bus id */ mutex_lock(&board_lock); if (found == ctlr) @@ -3113,6 +3107,12 @@ void spi_unregister_controller(struct spi_controller *ctlr) if (IS_ENABLED(CONFIG_SPI_DYNAMIC)) mutex_unlock(&ctlr->add_lock); + + /* Release the last reference on the controller if its driver + * has not yet been converted to devm_spi_alloc_master/slave(). + */ + if (!ctlr->devm_allocated) + put_device(&ctlr->dev); } EXPORT_SYMBOL_GPL(spi_unregister_controller); |