diff mbox

[PATCH/RFC,0/4] convert HS-MMC driver to hwmod + runtime PM

Message ID 87ocjftq0z.fsf@deeprootsystems.com (mailing list archive)
State RFC
Delegated to: Kevin Hilman
Headers show

Commit Message

Kevin Hilman Feb. 24, 2010, 12:51 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 16d66b9..dd027bb 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2222,6 +2222,9 @@  static int omap_hsmmc_suspend(struct device *dev)
 	if (host && host->suspended)
 		return 0;
 
+	if (pm_is_runtime_suspended(host->dev))
+		return 0;
+
 	if (host) {
 		host->suspended = 1;
 		if (host->pdata->suspend) {
@@ -2260,12 +2263,6 @@  static int omap_hsmmc_suspend(struct device *dev)
 			}
 			mmc_host_disable(host->mmc);
 		}
-
-		/*
-		 * HACK: "extra" put to compensate for DPM core keeping
-		 *       runtime PM disabled.  -- khilman
-		 */
-		pm_runtime_put_sync(host->dev);
 	}
 	return ret;
 }
@@ -2280,13 +2277,10 @@  static int omap_hsmmc_resume(struct device *dev)
 	if (host && !host->suspended)
 		return 0;
 
-	if (host) {
-		/*
-		 * HACK: "extra" get to compensate for DPM core keeping
-		 *       runtime PM disabled.  -- khilman
-		 */
-		pm_runtime_get_sync(host->dev);
+	if (pm_is_runtime_suspended(host->dev))
+		return 0;
 
+	if (host) {
 		if (mmc_host_enable(host->mmc) != 0) {
 			pm_runtime_suspend(host->dev);
 			goto clk_en_err;