Skip to content

Commit 6e001f6

Browse files
WillLesterdlezcano
authored andcommitted
clocksource/drivers/asm9260: Add a check for of_clk_get
asm9260_timer_init misses a check for of_clk_get. Add a check for it and print errors like other clocksource drivers. Signed-off-by: Chuhong Yuan <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b35a5e5 commit 6e001f6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/clocksource/asm9260_timer.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ static int __init asm9260_timer_init(struct device_node *np)
194194
}
195195

196196
clk = of_clk_get(np, 0);
197+
if (IS_ERR(clk)) {
198+
pr_err("Failed to get clk!\n");
199+
return PTR_ERR(clk);
200+
}
197201

198202
ret = clk_prepare_enable(clk);
199203
if (ret) {

0 commit comments

Comments
 (0)