msm: clock-voter: Remove 'rate' field from struct clk_voter
Struct clk has a rate field now. Remove the clk_voter-specific
field and use the generic one instead.
This also allows voter_clk_get_rate() to be removed completely
since the default implementation does the same thing.
Change-Id: Ibf4042e7f1ae63784839ff34419fc0af341011d2
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
diff --git a/arch/arm/mach-msm/clock-voter.c b/arch/arm/mach-msm/clock-voter.c
index 9ad653d..8ff4878 100644
--- a/arch/arm/mach-msm/clock-voter.c
+++ b/arch/arm/mach-msm/clock-voter.c
@@ -29,7 +29,7 @@
list_for_each_entry(clk, &parent->children, siblings) {
struct clk_voter *v = to_clk_voter(clk);
if (v->enabled)
- rate = max(v->rate, rate);
+ rate = max(clk->rate, rate);
}
return rate;
}
@@ -54,10 +54,10 @@
list_for_each_entry(clkp, &parent->children, siblings) {
clkh = to_clk_voter(clkp);
if (clkh->enabled && clkh != v)
- other_rate = max(clkh->rate, other_rate);
+ other_rate = max(clkp->rate, other_rate);
}
- cur_rate = max(other_rate, v->rate);
+ cur_rate = max(other_rate, clk->rate);
new_rate = max(other_rate, rate);
if (new_rate != cur_rate) {
@@ -66,7 +66,7 @@
goto unlock;
}
}
- v->rate = rate;
+ clk->rate = rate;
unlock:
spin_unlock_irqrestore(&voter_clk_lock, flags);
@@ -89,8 +89,8 @@
* than the current rate.
*/
cur_rate = voter_clk_aggregate_rate(parent);
- if (v->rate > cur_rate) {
- ret = clk_set_rate(parent, v->rate);
+ if (clk->rate > cur_rate) {
+ ret = clk_set_rate(parent, clk->rate);
if (ret)
goto out;
}
@@ -116,7 +116,7 @@
*/
v->enabled = false;
new_rate = voter_clk_aggregate_rate(parent);
- cur_rate = max(new_rate, v->rate);
+ cur_rate = max(new_rate, clk->rate);
if (new_rate < cur_rate)
clk_set_rate(parent, new_rate);
@@ -124,18 +124,6 @@
spin_unlock_irqrestore(&voter_clk_lock, flags);
}
-static unsigned long voter_clk_get_rate(struct clk *clk)
-{
- unsigned long rate, flags;
- struct clk_voter *v = to_clk_voter(clk);
-
- spin_lock_irqsave(&voter_clk_lock, flags);
- rate = v->rate;
- spin_unlock_irqrestore(&voter_clk_lock, flags);
-
- return rate;
-}
-
static int voter_clk_is_enabled(struct clk *clk)
{
struct clk_voter *v = to_clk_voter(clk);
@@ -163,7 +151,6 @@
.enable = voter_clk_enable,
.disable = voter_clk_disable,
.set_rate = voter_clk_set_rate,
- .get_rate = voter_clk_get_rate,
.is_enabled = voter_clk_is_enabled,
.round_rate = voter_clk_round_rate,
.get_parent = voter_clk_get_parent,