diff mbox

[RFC,V1,2/8] clk: pass parent rate if recalc_rate is NULL

Message ID 1322046755-13511-3-git-send-email-richard.zhao@linaro.org
State RFC
Headers show

Commit Message

Richard Zhao Nov. 23, 2011, 11:12 a.m. UTC
Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
---
 drivers/clk/clk.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index ed557c9..2d8422f 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -256,6 +256,8 @@  static void clk_recalc_rates(struct clk *clk)
 
 	if (clk->ops->recalc_rate)
 		clk->rate = clk->ops->recalc_rate(clk);
+	else if (clk->parent)
+		clk->rate = clk->parent->rate;
 
 	if (old_rate == clk->rate)
 		return;
@@ -527,6 +529,8 @@  void clk_init(struct device *dev, struct clk *clk)
 
 	if (clk->ops->recalc_rate)
 		clk->rate = clk->ops->recalc_rate(clk);
+	else if (clk->parent)
+		clk->rate = clk->parent->rate;
 	else
 		clk->rate = 0;