File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
15301532static int atmel_spi_probe (struct platform_device * pdev )
Original file line number Diff line number Diff line change @@ -1802,6 +1802,8 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
18021802 return status ;
18031803
18041804out_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 );
Original file line number Diff line number Diff 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}
22842279EXPORT_SYMBOL_GPL (spi_unregister_controller );
You can’t perform that action at this time.
0 commit comments