Commit 6e001f6a authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Daniel Lezcano

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: default avatarChuhong Yuan <hslester96@gmail.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20191016124330.22211-1-hslester96@gmail.com
parent b35a5e59
...@@ -194,6 +194,10 @@ static int __init asm9260_timer_init(struct device_node *np) ...@@ -194,6 +194,10 @@ static int __init asm9260_timer_init(struct device_node *np)
} }
clk = of_clk_get(np, 0); clk = of_clk_get(np, 0);
if (IS_ERR(clk)) {
pr_err("Failed to get clk!\n");
return PTR_ERR(clk);
}
ret = clk_prepare_enable(clk); ret = clk_prepare_enable(clk);
if (ret) { if (ret) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment