Skip to content

Commit

Permalink
spi: fsl-dspi: Fix getting correct address for master
Browse files Browse the repository at this point in the history
commit 017145f 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>
  • Loading branch information
AxelLin authored and Jiri Slaby committed Mar 22, 2014
1 parent 4a0e004 commit c9381ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/spi/spi-fsl-dspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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) {
Expand All @@ -527,7 +526,8 @@ static int dspi_probe(struct platform_device *pdev)

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);
Expand Down

0 comments on commit c9381ca

Please sign in to comment.