Skip to content

Commit

Permalink
spi: coldfire-qspi: Fix getting correct address for *mcfqspi
Browse files Browse the repository at this point in the history
dev_get_drvdata() returns the address of master rather than mcfqspi.

Fixes: af36107 (spi/coldfire-qspi: Drop extra calls to spi_master_get in suspend/resume functions)
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
  • Loading branch information
Axel Lin authored and Mark Brown committed Mar 5, 2014
1 parent 38dbfb5 commit ee73b4c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/spi/spi-coldfire-qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,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);

Expand All @@ -523,7 +524,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);

Expand Down

0 comments on commit ee73b4c

Please sign in to comment.