summaryrefslogtreecommitdiff
path: root/drivers/clk/clk.c
diff options
context:
space:
mode:
authorMike Turquette <mturquette@linaro.org>2014-02-25 11:07:53 +0400
committerMike Turquette <mturquette@linaro.org>2014-02-25 11:07:53 +0400
commitad077ceb8a90c7ef1fc15758ed3811448181ee80 (patch)
treedc090e24bb82c41c3785e539b9e60df6c48abfaf /drivers/clk/clk.c
parentc05ab9a0cc8e2b958bb2db2f8f1d200e568a75d4 (diff)
parent10b7cdc0084c27a312e59e80420c6aac70c64753 (diff)
downloadlinux-ad077ceb8a90c7ef1fc15758ed3811448181ee80.tar.xz
Merge branch 'clk-fixes' into clk-next
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r--drivers/clk/clk.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index cc2ca9aebe02..895b3d204e22 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2229,24 +2229,25 @@ EXPORT_SYMBOL_GPL(devm_clk_unregister);
*/
int __clk_get(struct clk *clk)
{
- if (clk && !try_module_get(clk->owner))
- return 0;
+ if (clk) {
+ if (!try_module_get(clk->owner))
+ return 0;
- kref_get(&clk->ref);
+ kref_get(&clk->ref);
+ }
return 1;
}
void __clk_put(struct clk *clk)
{
- if (WARN_ON_ONCE(IS_ERR(clk)))
+ if (!clk || WARN_ON_ONCE(IS_ERR(clk)))
return;
clk_prepare_lock();
kref_put(&clk->ref, __clk_release);
clk_prepare_unlock();
- if (clk)
- module_put(clk->owner);
+ module_put(clk->owner);
}
/*** clk rate change notifiers ***/