Skip to content

Commit 2760878

Browse files
committed
clk: Bail out when calculating phase fails during clk registration
Bail out of clk registration if we fail to get the phase for a clk that has a clk_ops::get_phase() callback. Print a warning too so that driver authors can easily figure out that some clk is unable to read back phase information at boot. Cc: Douglas Anderson <[email protected]> Cc: Heiko Stuebner <[email protected]> Suggested-by: Jerome Brunet <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Acked-by: Jerome Brunet <[email protected]>
1 parent 0daa376 commit 2760878

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/clk/clk.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3457,7 +3457,12 @@ static int __clk_core_init(struct clk_core *core)
34573457
* Since a phase is by definition relative to its parent, just
34583458
* query the current clock phase, or just assume it's in phase.
34593459
*/
3460-
clk_core_get_phase(core);
3460+
ret = clk_core_get_phase(core);
3461+
if (ret < 0) {
3462+
pr_warn("%s: Failed to get phase for clk '%s'\n", __func__,
3463+
core->name);
3464+
goto out;
3465+
}
34613466

34623467
/*
34633468
* Set clk's duty cycle.

0 commit comments

Comments
 (0)