diff options
author | Grant Likely <grant.likely@linaro.org> | 2013-08-28 23:18:13 +0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2013-08-28 23:18:13 +0400 |
commit | 8be137f2664f0abb096626a9d2ce0fcdd955b109 (patch) | |
tree | 2c53a5535265a58eb397d6fbbab2ec26e92e6931 /drivers/misc/atmel-ssc.c | |
parent | 8851b9f1625ce0858e9b1bb0ae4a57d4b43178b1 (diff) | |
parent | d8dfad3876e4386666b759da3c833d62fb8b2267 (diff) | |
download | linux-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.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); 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); |