summaryrefslogtreecommitdiff
path: root/drivers/misc/atmel-ssc.c
diff options
context:
space:
mode:
authorBoris BREZILLON <b.brezillon@overkiz.com>2013-07-18 09:48:40 +0200
committerMark Brown <broonie@linaro.org>2013-07-18 12:24:33 +0100
commit9a9b1c618d835e7a6a4097eb47ee47991202a3c1 (patch)
tree34466de4928292a864235b022015c51b7ed5bd75 /drivers/misc/atmel-ssc.c
parentad81f0545ef01ea651886dddac4bef6cec930092 (diff)
ASoC: atmel-ssc: remove clk_disable_unprepare call from critical section
clk_prepare/unprepare (and indirectly clk_prepare_enable/disable_unprepare) may sleep and thus cannot be called in critical section. This patch fix a bug introduced by commit 6f0d94790efe9f4481bbd7c174ef0e9b5e5db7c4 where clk_disable_unprepare was called with user_lock hold. Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/misc/atmel-ssc.c')
-rw-r--r--drivers/misc/atmel-ssc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
index f7b90661e321..e068a76a5f6f 100644
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -66,14 +66,19 @@ EXPORT_SYMBOL(ssc_request);
void ssc_free(struct ssc_device *ssc)
{
+ bool disable_clk = true;
+
spin_lock(&user_lock);
- if (ssc->user) {
+ if (ssc->user)
ssc->user--;
- clk_disable_unprepare(ssc->clk);
- } else {
+ else {
+ disable_clk = false;
dev_dbg(&ssc->pdev->dev, "device already free\n");
}
spin_unlock(&user_lock);
+
+ if (disable_clk)
+ clk_disable_unprepare(ssc->clk);
}
EXPORT_SYMBOL(ssc_free);