linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: fsl-dspi: Fix getting correct address for master
@ 2014-02-14  4:49 Axel Lin
  2014-03-02 15:09 ` Axel Lin
  2014-03-05  3:49 ` Mark Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Axel Lin @ 2014-02-14  4:49 UTC (permalink / raw)
  To: Mark Brown; +Cc: Chao Fu, Alison Wang, linux-spi-u79uwXL29TY76Z2rM5mHXA

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-8E1dMatC8ynQT0dZR+AlfA@public.gmane.org>
---
 drivers/spi/spi-fsl-dspi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
index ec79f72..a253920 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);
-- 
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-03-05  3:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-14  4:49 [PATCH] spi: fsl-dspi: Fix getting correct address for master Axel Lin
2014-03-02 15:09 ` Axel Lin
     [not found]   ` <CAFRkauD3WFBw9VC6h+2bxcnuky7175G47+7tP8=5f4D2PeLpEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-03  1:46     ` Mark Brown
     [not found]       ` <20140303014608.GL2411-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-03-03  8:42         ` Axel Lin
     [not found]           ` <CAFRkauC7z4UepyK-oH861OEo62+4b82idWPAkK99vmY0=T3w9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-05  3:54             ` Mark Brown
2014-03-05  3:49 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).