diff mbox

[1/3] spi: coldfire-qspi: Fix getting correct address for *mcfqspi

Message ID 1392342780.22981.0.camel@phoenix (mailing list archive)
State Accepted
Commit ee73b4c6e3fc0755a91752ab8eebc8e070038b53
Delegated to: Mark Brown
Headers show

Commit Message

Axel Lin Feb. 14, 2014, 1:53 a.m. UTC
dev_get_drvdata() returns the address of master rather than mcfqspi.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/spi/spi-coldfire-qspi.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Mark Brown Feb. 23, 2014, 4:10 a.m. UTC | #1
On Fri, Feb 14, 2014 at 09:53:00AM +0800, Axel Lin wrote:
> dev_get_drvdata() returns the address of master rather than mcfqspi.

Applied all, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c
index 0ab2c55..8e4f1c9c 100644
--- a/drivers/spi/spi-coldfire-qspi.c
+++ b/drivers/spi/spi-coldfire-qspi.c
@@ -508,7 +508,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);
 
@@ -517,7 +518,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);