diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-02-14 12:49:12 +0800 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-03-22 22:01:58 +0100 |
commit | c9381cae8a2072c53bea7cd87c5ec517a1545121 (patch) | |
tree | d8c75d079fb1f7e93bcf7dfcd4e4640e5b41f69e | |
parent | 4a0e004916ab80a3608e54f895af21d08ab36d08 (diff) |
spi: fsl-dspi: Fix getting correct address for master
commit 017145fef567430789e40f6a22a90ce2a766370b upstream.
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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-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 4e44575bd87a..f1322343d789 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -421,7 +421,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); @@ -505,7 +504,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) { @@ -527,7 +526,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); |