diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-02-14 12:49:12 +0800 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-05 11:51:02 +0800 |
commit | 017145fef567430789e40f6a22a90ce2a766370b (patch) | |
tree | d827a156c9f6defa5d1934df1dafce6b7c5534ce /drivers | |
parent | 38dbfb59d1175ef458d006556061adeaa8751b72 (diff) | |
download | linux-017145fef567430789e40f6a22a90ce2a766370b.tar.gz linux-017145fef567430789e40f6a22a90ce2a766370b.tar.bz2 linux-017145fef567430789e40f6a22a90ce2a766370b.zip |
spi: fsl-dspi: Fix getting correct address for master
Current code set platform drvdata to dspi. However, the code in dspi_suspend()
and dspi_resume() assumes the drvdata is the address of master.
Fix it by setting platform drvdata to master.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/spi-fsl-dspi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index ec79f726672a..a25392065d9b 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -420,7 +420,6 @@ static int dspi_suspend(struct device *dev) static int dspi_resume(struct device *dev) { - struct spi_master *master = dev_get_drvdata(dev); struct fsl_dspi *dspi = spi_master_get_devdata(master); @@ -504,7 +503,7 @@ static int dspi_probe(struct platform_device *pdev) clk_prepare_enable(dspi->clk); init_waitqueue_head(&dspi->waitq); - platform_set_drvdata(pdev, dspi); + platform_set_drvdata(pdev, master); ret = spi_bitbang_start(&dspi->bitbang); if (ret != 0) { @@ -525,7 +524,8 @@ out_master_put: static int dspi_remove(struct platform_device *pdev) { - struct fsl_dspi *dspi = platform_get_drvdata(pdev); + struct spi_master *master = platform_get_drvdata(pdev); + struct fsl_dspi *dspi = spi_master_get_devdata(master); /* Disconnect from the SPI framework */ spi_bitbang_stop(&dspi->bitbang); |