Message ID | 1393379275.7490.1.camel@phoenix (mailing list archive) |
---|---|
State | Accepted |
Commit | 2aa237f4a1a72813f9684a0ce6e48288e75de479 |
Delegated to: | Mark Brown |
Headers | show |
On Wed, Feb 26, 2014 at 09:47:55AM +0800, Axel Lin wrote: > 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. Applied, thanks.
diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c index c29bbb0..62daf87 100644 --- a/drivers/spi/spi-coldfire-qspi.c +++ b/drivers/spi/spi-coldfire-qspi.c @@ -467,8 +467,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); @@ -480,11 +483,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
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> --- drivers/spi/spi-coldfire-qspi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)