From: Ulf Hansson <ulf.hans...@linaro.org>

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.hans...@linaro.org>
Signed-off-by: Linus Walleij <linus.wall...@linaro.org>
---
 drivers/spi/spi-pl022.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 51b7a95..51329b2 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2346,6 +2346,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");
@@ -2358,6 +2360,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);
-- 
1.7.11.3


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

Reply via email to