Skip to content

Commit df273ce

Browse files
AxelLingregkh
authored andcommitted
spi: fsl-dspi: Fix getting correct address for master
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 <[email protected]> Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1a8f08e commit df273ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/spi/spi-fsl-dspi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ static int dspi_suspend(struct device *dev)
421421

422422
static int dspi_resume(struct device *dev)
423423
{
424-
425424
struct spi_master *master = dev_get_drvdata(dev);
426425
struct fsl_dspi *dspi = spi_master_get_devdata(master);
427426

@@ -505,7 +504,7 @@ static int dspi_probe(struct platform_device *pdev)
505504
clk_prepare_enable(dspi->clk);
506505

507506
init_waitqueue_head(&dspi->waitq);
508-
platform_set_drvdata(pdev, dspi);
507+
platform_set_drvdata(pdev, master);
509508

510509
ret = spi_bitbang_start(&dspi->bitbang);
511510
if (ret != 0) {
@@ -526,7 +525,8 @@ static int dspi_probe(struct platform_device *pdev)
526525

527526
static int dspi_remove(struct platform_device *pdev)
528527
{
529-
struct fsl_dspi *dspi = platform_get_drvdata(pdev);
528+
struct spi_master *master = platform_get_drvdata(pdev);
529+
struct fsl_dspi *dspi = spi_master_get_devdata(master);
530530

531531
/* Disconnect from the SPI framework */
532532
spi_bitbang_stop(&dspi->bitbang);

0 commit comments

Comments
 (0)