linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: clk_calc_new_rates() required for parent only if CLK_SET_RATE_PARENT is set
@ 2012-04-11  6:08 Viresh Kumar
  2012-04-11  6:43 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2012-04-11  6:08 UTC (permalink / raw)
  To: linux-arm-kernel

We need to call clk_calc_new_rates() for parent clock only when we have
CLK_SET_RATE_PARENT flag set for clock.

This patch fixes it.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
 drivers/clk/clk.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 2f58455..56e32a1 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -780,15 +780,14 @@ static struct clk *clk_calc_new_rates(struct clk *clk, unsigned long rate)
 		goto out;
 	}
 
-	if (clk->flags & CLK_SET_RATE_PARENT)
-		new_rate = clk->ops->round_rate(clk->hw, rate, &best_parent_rate);
-	else
-		new_rate = clk->ops->round_rate(clk->hw, rate, NULL);
-
-	if (best_parent_rate != clk->parent->rate) {
-		top = clk_calc_new_rates(clk->parent, best_parent_rate);
+	if (clk->flags & CLK_SET_RATE_PARENT) {
+		new_rate = clk->ops->round_rate(clk->hw, rate,
+				&best_parent_rate);
 
-		goto out;
+		if (best_parent_rate != clk->parent->rate)
+			top = clk_calc_new_rates(clk->parent, best_parent_rate);
+	} else {
+		new_rate = clk->ops->round_rate(clk->hw, rate, NULL);
 	}
 
 out:
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-11  6:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-11  6:08 [PATCH] clk: clk_calc_new_rates() required for parent only if CLK_SET_RATE_PARENT is set Viresh Kumar
2012-04-11  6:43 ` Sascha Hauer
2012-04-11  6:47   ` Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).