Skip to content

Commit

Permalink
spi/pl022: Activate resourses before deactivate them in suspend
Browse files Browse the repository at this point in the history
To be able to deactivate resourses in suspend, the resourses must
first be surely active. This is done with a pm_runtime_get_sync.
Once the resourses are restored to active state again in resume,
the runtime pm usage count can be decreased with a pm_runtime_put.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Ulf Hansson authored and Mark Brown committed Oct 17, 2012
1 parent 0df3499 commit 4964a26
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/spi/spi-pl022.c
Original file line number Diff line number Diff line change
Expand Up @@ -2349,6 +2349,8 @@ static int pl022_suspend(struct device *dev)
dev_warn(dev, "cannot suspend master\n");
return ret;
}

pm_runtime_get_sync(dev);
pl022_suspend_resources(pl022);

dev_dbg(dev, "suspended\n");
Expand All @@ -2361,6 +2363,7 @@ static int pl022_resume(struct device *dev)
int ret;

pl022_resume_resources(pl022);
pm_runtime_put(dev);

/* Start the queue running */
ret = spi_master_resume(pl022->master);
Expand Down

0 comments on commit 4964a26

Please sign in to comment.