diff options
author | Boris BREZILLON <b.brezillon@overkiz.com> | 2013-07-18 03:48:40 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-07-18 07:24:33 -0400 |
commit | 9a9b1c618d835e7a6a4097eb47ee47991202a3c1 (patch) | |
tree | 34466de4928292a864235b022015c51b7ed5bd75 | |
parent | ad81f0545ef01ea651886dddac4bef6cec930092 (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>
-rw-r--r-- | drivers/misc/atmel-ssc.c | 11 |
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); | |||
66 | 66 | ||
67 | void ssc_free(struct ssc_device *ssc) | 67 | void ssc_free(struct ssc_device *ssc) |
68 | { | 68 | { |
69 | bool disable_clk = true; | ||
70 | |||
69 | spin_lock(&user_lock); | 71 | spin_lock(&user_lock); |
70 | if (ssc->user) { | 72 | if (ssc->user) |
71 | ssc->user--; | 73 | ssc->user--; |
72 | clk_disable_unprepare(ssc->clk); | 74 | else { |
73 | } else { | 75 | disable_clk = false; |
74 | dev_dbg(&ssc->pdev->dev, "device already free\n"); | 76 | dev_dbg(&ssc->pdev->dev, "device already free\n"); |
75 | } | 77 | } |
76 | spin_unlock(&user_lock); | 78 | spin_unlock(&user_lock); |
79 | |||
80 | if (disable_clk) | ||
81 | clk_disable_unprepare(ssc->clk); | ||
77 | } | 82 | } |
78 | EXPORT_SYMBOL(ssc_free); | 83 | EXPORT_SYMBOL(ssc_free); |
79 | 84 | ||