Skip to content

Commit c38a490

Browse files
committed
2 parents 73da235 + b9dd3f6 commit c38a490

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

drivers/spi/spi-bcm2835.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,7 @@ static int bcm2835_spi_probe(struct platform_device *pdev)
13511351
goto out_dma_release;
13521352
}
13531353

1354-
err = devm_spi_register_controller(&pdev->dev, ctlr);
1354+
err = spi_register_controller(ctlr);
13551355
if (err) {
13561356
dev_err(&pdev->dev, "could not register SPI controller: %d\n",
13571357
err);
@@ -1378,6 +1378,8 @@ static int bcm2835_spi_remove(struct platform_device *pdev)
13781378

13791379
bcm2835_debugfs_remove(bs);
13801380

1381+
spi_unregister_controller(ctlr);
1382+
13811383
/* Clear FIFOs, and disable the HW block */
13821384
bcm2835_wr(bs, BCM2835_SPI_CS,
13831385
BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);

drivers/spi/spi-bcm2835aux.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev)
569569
goto out_clk_disable;
570570
}
571571

572-
err = devm_spi_register_master(&pdev->dev, master);
572+
err = spi_register_master(master);
573573
if (err) {
574574
dev_err(&pdev->dev, "could not register SPI master: %d\n", err);
575575
goto out_clk_disable;
@@ -593,6 +593,8 @@ static int bcm2835aux_spi_remove(struct platform_device *pdev)
593593

594594
bcm2835aux_debugfs_remove(bs);
595595

596+
spi_unregister_master(master);
597+
596598
bcm2835aux_spi_reset_hw(bs);
597599

598600
/* disable the HW block by releasing the clock */

drivers/spi/spi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2761,6 +2761,8 @@ void spi_unregister_controller(struct spi_controller *ctlr)
27612761
struct spi_controller *found;
27622762
int id = ctlr->bus_num;
27632763

2764+
device_for_each_child(&ctlr->dev, NULL, __unregister);
2765+
27642766
/* First make sure that this controller was ever added */
27652767
mutex_lock(&board_lock);
27662768
found = idr_find(&spi_master_idr, id);
@@ -2773,7 +2775,6 @@ void spi_unregister_controller(struct spi_controller *ctlr)
27732775
list_del(&ctlr->list);
27742776
mutex_unlock(&board_lock);
27752777

2776-
device_for_each_child(&ctlr->dev, NULL, __unregister);
27772778
device_unregister(&ctlr->dev);
27782779
/* free bus id */
27792780
mutex_lock(&board_lock);

0 commit comments

Comments
 (0)