提交 d672fef0 编写于 作者: P Paul Mundt

sh: clkfwk: Handle NULL clkops for root clocks.

root clocks may simply be placeholders for rate and ancestry information,
and have no real associated operations of their own. Account for this,
so we are still able to use these sorts of clocks for rate propagation.
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 af777ce4
......@@ -103,7 +103,7 @@ void propagate_rate(struct clk *tclk)
struct clk *clkp;
list_for_each_entry(clkp, &tclk->children, sibling) {
if (clkp->ops->recalc)
if (clkp->ops && clkp->ops->recalc)
clkp->rate = clkp->ops->recalc(clkp);
propagate_rate(clkp);
}
......@@ -196,7 +196,7 @@ void recalculate_root_clocks(void)
struct clk *clkp;
list_for_each_entry(clkp, &root_clks, sibling) {
if (clkp->ops->recalc)
if (clkp->ops && clkp->ops->recalc)
clkp->rate = clkp->ops->recalc(clkp);
propagate_rate(clkp);
}
......@@ -224,7 +224,7 @@ int clk_register(struct clk *clk)
list_add(&clk->sibling, &root_clks);
list_add(&clk->node, &clock_list);
if (clk->ops->init)
if (clk->ops && clk->ops->init)
clk->ops->init(clk);
mutex_unlock(&clock_list_sem);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册