Skip to content

Commit d672fef

Browse files
committed
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: Paul Mundt <lethal@linux-sh.org>
1 parent af777ce commit d672fef

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎arch/sh/kernel/cpu/clock.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void propagate_rate(struct clk *tclk)
103103
struct clk *clkp;
104104

105105
list_for_each_entry(clkp, &tclk->children, sibling) {
106-
if (clkp->ops->recalc)
106+
if (clkp->ops && clkp->ops->recalc)
107107
clkp->rate = clkp->ops->recalc(clkp);
108108
propagate_rate(clkp);
109109
}
@@ -196,7 +196,7 @@ void recalculate_root_clocks(void)
196196
struct clk *clkp;
197197

198198
list_for_each_entry(clkp, &root_clks, sibling) {
199-
if (clkp->ops->recalc)
199+
if (clkp->ops && clkp->ops->recalc)
200200
clkp->rate = clkp->ops->recalc(clkp);
201201
propagate_rate(clkp);
202202
}
@@ -224,7 +224,7 @@ int clk_register(struct clk *clk)
224224
list_add(&clk->sibling, &root_clks);
225225

226226
list_add(&clk->node, &clock_list);
227-
if (clk->ops->init)
227+
if (clk->ops && clk->ops->init)
228228
clk->ops->init(clk);
229229
mutex_unlock(&clock_list_sem);
230230

0 commit comments

Comments
 (0)