mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
spi: coldfire-qspi: Enable clock before calling spi_master_resume
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>
This commit is contained in:
parent
3531b717d0
commit
2aa237f4a1
1 changed files with 5 additions and 4 deletions
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue