Skip to content

Commit 3ce2dcf

Browse files
committed
Merge remote-tracking branches 'spi/fix/atmel', 'spi/fix/pxa2xx' and 'spi/fix/unregiser' into spi-linus
4 parents 43ff2dc + 9581329 + e2b714a + 613bd1e commit 3ce2dcf

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

‎drivers/spi/spi-atmel.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,11 @@ static void atmel_spi_init(struct atmel_spi *as)
15121512
{
15131513
spi_writel(as, CR, SPI_BIT(SWRST));
15141514
spi_writel(as, CR, SPI_BIT(SWRST)); /* AT91SAM9263 Rev B workaround */
1515+
1516+
/* It is recommended to enable FIFOs first thing after reset */
1517+
if (as->fifo_size)
1518+
spi_writel(as, CR, SPI_BIT(FIFOEN));
1519+
15151520
if (as->caps.has_wdrbt) {
15161521
spi_writel(as, MR, SPI_BIT(WDRBT) | SPI_BIT(MODFDIS)
15171522
| SPI_BIT(MSTR));
@@ -1522,9 +1527,6 @@ static void atmel_spi_init(struct atmel_spi *as)
15221527
if (as->use_pdc)
15231528
spi_writel(as, PTCR, SPI_BIT(RXTDIS) | SPI_BIT(TXTDIS));
15241529
spi_writel(as, CR, SPI_BIT(SPIEN));
1525-
1526-
if (as->fifo_size)
1527-
spi_writel(as, CR, SPI_BIT(FIFOEN));
15281530
}
15291531

15301532
static int atmel_spi_probe(struct platform_device *pdev)

‎drivers/spi/spi-pxa2xx.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,6 +1802,8 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
18021802
return status;
18031803

18041804
out_error_clock_enabled:
1805+
pm_runtime_put_noidle(&pdev->dev);
1806+
pm_runtime_disable(&pdev->dev);
18051807
clk_disable_unprepare(ssp->clk);
18061808
pxa2xx_spi_dma_release(drv_data);
18071809
free_irq(ssp->irq, drv_data);

‎drivers/spi/spi.c‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2260,12 +2260,6 @@ void spi_unregister_controller(struct spi_controller *ctlr)
22602260
mutex_lock(&board_lock);
22612261
found = idr_find(&spi_master_idr, id);
22622262
mutex_unlock(&board_lock);
2263-
if (found != ctlr) {
2264-
dev_dbg(&ctlr->dev,
2265-
"attempting to delete unregistered controller [%s]\n",
2266-
dev_name(&ctlr->dev));
2267-
return;
2268-
}
22692263
if (ctlr->queued) {
22702264
if (spi_destroy_queue(ctlr))
22712265
dev_err(&ctlr->dev, "queue remove failed\n");
@@ -2278,7 +2272,8 @@ void spi_unregister_controller(struct spi_controller *ctlr)
22782272
device_unregister(&ctlr->dev);
22792273
/* free bus id */
22802274
mutex_lock(&board_lock);
2281-
idr_remove(&spi_master_idr, id);
2275+
if (found == ctlr)
2276+
idr_remove(&spi_master_idr, id);
22822277
mutex_unlock(&board_lock);
22832278
}
22842279
EXPORT_SYMBOL_GPL(spi_unregister_controller);

0 commit comments

Comments
 (0)