mmc: check for > 1 clk_requests when disabling gating
authorLinus Walleij <linus.ml.walleij@gmail.com>
Wed, 22 Dec 2010 08:50:12 +0000 (09:50 +0100)
committerChris Ball <cjb@laptop.org>
Sun, 9 Jan 2011 04:52:22 +0000 (23:52 -0500)
Since we make sure the clock is enabled in the mmc_host_clk_exit()
function we should expect a reference counter of 1, not 0.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Tested-by: Chris Ball <cjb@laptop.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/core/host.c

index 92e33703e4375c986458768fd275b78225b29bc4..b3ac6c5bc5c6289b39299e715d0feb01170b22bb 100644 (file)
@@ -235,7 +235,8 @@ static inline void mmc_host_clk_exit(struct mmc_host *host)
                mmc_host_clk_gate_delayed(host);
        if (host->clk_gated)
                mmc_host_clk_ungate(host);
-       BUG_ON(host->clk_requests > 0);
+       /* There should be only one user now */
+       WARN_ON(host->clk_requests > 1);
 }
 
 #else