aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-mxs.c
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2013-07-09 23:16:27 -0400
committerMark Brown <broonie@linaro.org>2013-07-15 06:38:41 -0400
commite11933f626c0a1333ec118d35a0c6c90d576b707 (patch)
tree33114830c13095eb958f62ab58fa6acced3eff75 /drivers/spi/spi-mxs.c
parentad81f0545ef01ea651886dddac4bef6cec930092 (diff)
spi: spi-mxs: Fix the error path sequence
On mxs_spi_probe() the dma channels are requested prior to enabling the SSP clock, so in the error path we should disable the SSP clock first and release the DMA channels later. Same logic applies in mxs_spi_remove(). Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Marek Vasut <marex@denx.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-mxs.c')
-rw-r--r--drivers/spi/spi-mxs.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c
index 424d38e59421..92254a1672e7 100644
--- a/drivers/spi/spi-mxs.c
+++ b/drivers/spi/spi-mxs.c
@@ -580,8 +580,8 @@ static int mxs_spi_probe(struct platform_device *pdev)
580 return 0; 580 return 0;
581 581
582out_free_dma: 582out_free_dma:
583 dma_release_channel(ssp->dmach);
584 clk_disable_unprepare(ssp->clk); 583 clk_disable_unprepare(ssp->clk);
584 dma_release_channel(ssp->dmach);
585out_master_free: 585out_master_free:
586 spi_master_put(master); 586 spi_master_put(master);
587 return ret; 587 return ret;
@@ -598,11 +598,8 @@ static int mxs_spi_remove(struct platform_device *pdev)
598 ssp = &spi->ssp; 598 ssp = &spi->ssp;
599 599
600 spi_unregister_master(master); 600 spi_unregister_master(master);
601
602 dma_release_channel(ssp->dmach);
603
604 clk_disable_unprepare(ssp->clk); 601 clk_disable_unprepare(ssp->clk);
605 602 dma_release_channel(ssp->dmach);
606 spi_master_put(master); 603 spi_master_put(master);
607 604
608 return 0; 605 return 0;