mmc: core: Add claiming of hosts during mmc_cache_ctrl
authorSeungwon Jeon <tgih.jun@samsung.com>
Mon, 26 Dec 2011 09:03:05 +0000 (18:03 +0900)
committerChris Ball <cjb@laptop.org>
Thu, 12 Jan 2012 04:58:46 +0000 (23:58 -0500)
While calling mmc_cache_ctrl() a host is not claimed. This patch
adds the mmc_try_claim_host() for quick response in suspend.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/core/core.c

index a2aa860956efb44085a766d76b9c7c1e98cc7992..22050525be84910733802a70543b309b26e3906d 100644 (file)
@@ -2355,7 +2355,13 @@ int mmc_suspend_host(struct mmc_host *host)
                cancel_delayed_work(&host->disable);
        cancel_delayed_work(&host->detect);
        mmc_flush_scheduled_work();
-       err = mmc_cache_ctrl(host, 0);
+       if (mmc_try_claim_host(host)) {
+               err = mmc_cache_ctrl(host, 0);
+               mmc_do_release_host(host);
+       } else {
+               err = -EBUSY;
+       }
+
        if (err)
                goto out;
 
This page took 0.034825 seconds and 5 git commands to generate.