spi: spi-mxs: Fix the error path sequence
authorFabio Estevam <fabio.estevam@freescale.com>
Wed, 10 Jul 2013 03:16:27 +0000 (00:16 -0300)
committerMark Brown <broonie@linaro.org>
Mon, 15 Jul 2013 10:38:41 +0000 (11:38 +0100)
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>
drivers/spi/spi-mxs.c

index 424d38e59421db2c621e1a14c1950f3777b7de75..92254a1672e7109b3a00e28cae8e2deb1865962d 100644 (file)
@@ -580,8 +580,8 @@ static int mxs_spi_probe(struct platform_device *pdev)
        return 0;
 
 out_free_dma:
-       dma_release_channel(ssp->dmach);
        clk_disable_unprepare(ssp->clk);
+       dma_release_channel(ssp->dmach);
 out_master_free:
        spi_master_put(master);
        return ret;
@@ -598,11 +598,8 @@ static int mxs_spi_remove(struct platform_device *pdev)
        ssp = &spi->ssp;
 
        spi_unregister_master(master);
-
-       dma_release_channel(ssp->dmach);
-
        clk_disable_unprepare(ssp->clk);
-
+       dma_release_channel(ssp->dmach);
        spi_master_put(master);
 
        return 0;
This page took 0.024762 seconds and 5 git commands to generate.