Re: [PATCH] clk: unlock for handling unregisterd clock

From: Stephen Boyd
Date: Mon Feb 01 2016 - 21:42:05 EST


On 01/30, Insu Yun wrote:
> If clock is already unregistered, it returns with holding lock.
> It needs to be unlocked.
>
> Signed-off-by: Insu Yun <wuninsu@xxxxxxxxx>
> ---

Applied to clk-next but I changed it to a goto:

---8<---
From: Insu Yun <wuninsu@xxxxxxxxx>
Subject: [PATCH] clk: unlock for handling unregisterd clock

If clock is already unregistered, it returns with holding lock.
It needs to be unlocked.

Signed-off-by: Insu Yun <wuninsu@xxxxxxxxx>
[sboyd@xxxxxxxxxxxxxx: Use goto instead]
Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxxxxxx>
---
drivers/clk/clk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index fff87b39944f..7d247a26a212 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2639,7 +2639,7 @@ void clk_unregister(struct clk *clk)
if (clk->core->ops == &clk_nodrv_ops) {
pr_err("%s: unregistered clock: %s\n", __func__,
clk->core->name);
- return;
+ goto unlock;
}
/*
* Assign empty clock ops for consumers that might still hold
@@ -2665,7 +2665,7 @@ void clk_unregister(struct clk *clk)
pr_warn("%s: unregistering prepared clock: %s\n",
__func__, clk->core->name);
kref_put(&clk->core->ref, __clk_release);
-
+unlock:
clk_prepare_unlock();
}
EXPORT_SYMBOL_GPL(clk_unregister);
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project