diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-02-14 09:53:00 +0800 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2014-03-22 22:01:57 +0100 |
commit | 4a0e004916ab80a3608e54f895af21d08ab36d08 (patch) | |
tree | 9fc609b54efe23de5d7031b56d9972302aa8a913 /drivers/spi | |
parent | 04da573274f14d9167901f6b8b38d7cc521f08ac (diff) |
spi: coldfire-qspi: Fix getting correct address for *mcfqspi
commit ee73b4c6e3fc0755a91752ab8eebc8e070038b53 upstream.
dev_get_drvdata() returns the address of master rather than mcfqspi.
Fixes: af361079 (spi/coldfire-qspi: Drop extra calls to spi_master_get in suspend/resume functions)
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>
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-coldfire-qspi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c index cc5b75d10c3..524d112d536 100644 --- a/drivers/spi/spi-coldfire-qspi.c +++ b/drivers/spi/spi-coldfire-qspi.c @@ -539,7 +539,8 @@ static int mcfqspi_resume(struct device *dev) #ifdef CONFIG_PM_RUNTIME static int mcfqspi_runtime_suspend(struct device *dev) { - struct mcfqspi *mcfqspi = dev_get_drvdata(dev); + struct spi_master *master = dev_get_drvdata(dev); + struct mcfqspi *mcfqspi = spi_master_get_devdata(master); clk_disable(mcfqspi->clk); @@ -548,7 +549,8 @@ static int mcfqspi_runtime_suspend(struct device *dev) static int mcfqspi_runtime_resume(struct device *dev) { - struct mcfqspi *mcfqspi = dev_get_drvdata(dev); + struct spi_master *master = dev_get_drvdata(dev); + struct mcfqspi *mcfqspi = spi_master_get_devdata(master); clk_enable(mcfqspi->clk); |