diff mbox

[RFC,V2,1/8] clk: pass parent rate if recalc_rate is NULL

Message ID 1323912295-21144-1-git-send-email-richard.zhao@freescale.com
State RFC
Headers show

Commit Message

Richard Zhao Dec. 15, 2011, 1:24 a.m. UTC
From: Richard Zhao <richard.zhao@linaro.org>

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 a6ddbb1..30ba22e 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -470,6 +470,8 @@  static void __clk_recalc_rates(struct clk *clk, unsigned long msg)
 
 	if (clk->ops->recalc_rate)
 		clk->rate = clk->ops->recalc_rate(clk);
+	else if (clk->parent)
+		clk->rate = clk->parent->rate;
 
 	/* ignore return value for POST_RATE_CHANGE & ABORT_RATE_CHANGE */
 	if (clk->notifier_count)
@@ -864,6 +866,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;