Skip to content

Commit

Permalink
spi: coldfire-qspi: Enable clock before calling spi_master_resume
Browse files Browse the repository at this point in the history
This ensures clock has been enabled before calling spi_master_resume().
while at it, also add checking return value of spi_master_suspend and
spi_master_resume because they may fail.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Mar 10, 2014
1 parent 3531b71 commit 2aa237f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/spi/spi-coldfire-qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,11 @@ static int mcfqspi_suspend(struct device *dev)
{
struct spi_master *master = dev_get_drvdata(dev);
struct mcfqspi *mcfqspi = spi_master_get_devdata(master);
int ret;

spi_master_suspend(master);
ret = spi_master_suspend(master);
if (ret)
return ret;

clk_disable(mcfqspi->clk);

Expand All @@ -486,11 +489,9 @@ static int mcfqspi_resume(struct device *dev)
struct spi_master *master = dev_get_drvdata(dev);
struct mcfqspi *mcfqspi = spi_master_get_devdata(master);

spi_master_resume(master);

clk_enable(mcfqspi->clk);

return 0;
return spi_master_resume(master);
}
#endif

Expand Down

0 comments on commit 2aa237f

Please sign in to comment.