diff options
author | Mark Brown <broonie@kernel.org> | 2020-05-20 17:55:07 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-05-20 17:55:07 +0100 |
commit | c38a4905caaf78fd7ce8ecece6d3a966933968db (patch) | |
tree | ae20ccf59b023dc977a7ff06a960c91d71f0e036 | |
parent | 73da2352075adb24868229f9463736a5dd331b95 (diff) | |
parent | b9dd3f6d417258ad0beeb292a1bc74200149f15d (diff) | |
download | linux-c38a4905caaf78fd7ce8ecece6d3a966933968db.tar.gz linux-c38a4905caaf78fd7ce8ecece6d3a966933968db.tar.bz2 linux-c38a4905caaf78fd7ce8ecece6d3a966933968db.zip |
Merge branch 'for-5.7' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.8
-rw-r--r-- | drivers/spi/spi-bcm2835.c | 4 | ||||
-rw-r--r-- | drivers/spi/spi-bcm2835aux.c | 4 | ||||
-rw-r--r-- | drivers/spi/spi.c | 3 |
3 files changed, 8 insertions, 3 deletions
diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index cad3458e23ed..06d2782d38ec 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1351,7 +1351,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev) goto out_dma_release; } - err = devm_spi_register_controller(&pdev->dev, ctlr); + err = spi_register_controller(ctlr); if (err) { dev_err(&pdev->dev, "could not register SPI controller: %d\n", err); @@ -1378,6 +1378,8 @@ static int bcm2835_spi_remove(struct platform_device *pdev) bcm2835_debugfs_remove(bs); + spi_unregister_controller(ctlr); + /* Clear FIFOs, and disable the HW block */ bcm2835_wr(bs, BCM2835_SPI_CS, BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX); diff --git a/drivers/spi/spi-bcm2835aux.c b/drivers/spi/spi-bcm2835aux.c index a2162ff56a12..c331efd6e86b 100644 --- a/drivers/spi/spi-bcm2835aux.c +++ b/drivers/spi/spi-bcm2835aux.c @@ -569,7 +569,7 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev) goto out_clk_disable; } - err = devm_spi_register_master(&pdev->dev, master); + err = spi_register_master(master); if (err) { dev_err(&pdev->dev, "could not register SPI master: %d\n", err); goto out_clk_disable; @@ -593,6 +593,8 @@ static int bcm2835aux_spi_remove(struct platform_device *pdev) bcm2835aux_debugfs_remove(bs); + spi_unregister_master(master); + bcm2835aux_spi_reset_hw(bs); /* disable the HW block by releasing the clock */ 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); |