summaryrefslogtreecommitdiff
path: root/drivers/misc/atmel-ssc.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2013-08-28 23:18:13 +0400
committerGrant Likely <grant.likely@linaro.org>2013-08-28 23:18:13 +0400
commit8be137f2664f0abb096626a9d2ce0fcdd955b109 (patch)
tree2c53a5535265a58eb397d6fbbab2ec26e92e6931 /drivers/misc/atmel-ssc.c
parent8851b9f1625ce0858e9b1bb0ae4a57d4b43178b1 (diff)
parentd8dfad3876e4386666b759da3c833d62fb8b2267 (diff)
downloadlinux-8be137f2664f0abb096626a9d2ce0fcdd955b109.tar.xz
Merge tag 'v3.11-rc7' into devicetree/next
Linux 3.11-rc7
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);