aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/spi/spi.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2020-05-20 17:55:07 +0100
committerMark Brown <broonie@kernel.org>2020-05-20 17:55:07 +0100
commitc38a4905caaf78fd7ce8ecece6d3a966933968db (patch)
treeae20ccf59b023dc977a7ff06a960c91d71f0e036 /drivers/spi/spi.c
parentspi: ti_qspi: fix unit address (diff)
parentspi: bcm2835aux: Fix controller unregister order (diff)
downloadwireguard-linux-c38a4905caaf78fd7ce8ecece6d3a966933968db.tar.xz
wireguard-linux-c38a4905caaf78fd7ce8ecece6d3a966933968db.zip
Merge branch 'for-5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.8
Diffstat (limited to '')
-rw-r--r--drivers/spi/spi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index c083ee3995e4..d32bdc6cbf66 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -2761,6 +2761,8 @@ void spi_unregister_controller(struct spi_controller *ctlr)
struct spi_controller *found;
int id = ctlr->bus_num;
+ device_for_each_child(&ctlr->dev, NULL, __unregister);
+
/* First make sure that this controller was ever added */
mutex_lock(&board_lock);
found = idr_find(&spi_master_idr, id);
@@ -2773,7 +2775,6 @@ void spi_unregister_controller(struct spi_controller *ctlr)
list_del(&ctlr->list);
mutex_unlock(&board_lock);
- device_for_each_child(&ctlr->dev, NULL, __unregister);
device_unregister(&ctlr->dev);
/* free bus id */
mutex_lock(&board_lock);