Skip to contentSkip to conversation

spi: fsl-dspi: Fix getting correct address for master

PATCH Applied Axel Lin 2 participants 6 messages Feb 14, 2014 – Mar 5, 2014 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/spi/spi-fsl-dspi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/spi/spi-fsl-dspi.c +3 -3
index ec79f72..a253920 100644
@@ -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);
Signature · 8 lines
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
author
#1 lore raw

2014-02-14 12:49 GMT+08:00 Axel Lin <[email protected]>:

Quoted 3 lines

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.

Hi Mark,
I guess this one is for 3.14.

In dspi_probe(),
current code has:

        platform_set_drvdata(pdev, dspi);

However, in dspi_suspend() and dspi_resume(),
current code has:

        struct spi_master *master = dev_get_drvdata(dev);

Regards,
Axel

Quoted 38 lines
---
 drivers/spi/spi-fsl-dspi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/spi/spi-fsl-dspi.c +3 -4
index ec79f72..a253920 100644
@@ -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);
--
Quoted 4 lines

1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAFRkauD3WFBw9VC6h+2bxcnuky7175G47+7tP8=5f4D2PeLpEQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#3 lore raw
Quoted 8 lines · Axel Lin

2014-02-14 12:49 GMT+08:00 Axel Lin <[email protected]>:

Quoted 3 lines

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.

Hi Mark,
I guess this one is for 3.14.

Quoted 7 lines

In dspi_probe(),
current code has:

        platform_set_drvdata(pdev, dspi);

However, in dspi_suspend() and dspi_resume(),
current code has:

        struct spi_master *master = dev_get_drvdata(dev);

The patch doesn't seem to have been appleid at all?

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#5 lore raw

2014-03-03 9:46 GMT+08:00 Mark Brown <[email protected]>:

Quoted 13 lines · Axel Lin
Quoted 11 lines

2014-02-14 12:49 GMT+08:00 Axel Lin <[email protected]>:

Quoted 3 lines

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.

Hi Mark,
I guess this one is for 3.14.

In dspi_probe(),
current code has:

        platform_set_drvdata(pdev, dspi);
Quoted 5 lines
Quoted 3 lines

However, in dspi_suspend() and dspi_resume(),
current code has:

        struct spi_master *master = dev_get_drvdata(dev);

The patch doesn't seem to have been appleid at all?

Ah, right , this one is not yet in your tree.

And I think a similar patch for coldfire-qspi needs for 3.14 to make runtime suspend/resume work.

commit 80467f761b01a2df5284661e9bf9876eee6a9573
spi: coldfire-qspi: Fix getting correct address for *mcfqspi

dev_get_drvdata() returns the address of master rather than mcfqspi.

Regards,
Axel
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAFRkauC7z4UepyK-oH861OEo62+4b82idWPAkK99vmY0=T3w9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#7 lore raw
Quoted 7 lines · Axel Lin

And I think a similar patch for coldfire-qspi needs for 3.14 to make runtime suspend/resume work.

commit 80467f761b01a2df5284661e9bf9876eee6a9573
spi: coldfire-qspi: Fix getting correct address for *mcfqspi

dev_get_drvdata() returns the address of master rather than mcfqspi.

Yes, looks like it.

Applied
#8 lore raw
In reply to Axel Lin
Quoted 3 lines · Axel Lin

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.

Applied, thanks.