Commit efee788c authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Kleber Sacilotto de Souza

clocksource/drivers/asm9260: Add a check for of_clk_get

BugLink: https://bugs.launchpad.net/bugs/1858462

[ Upstream commit 6e001f6a ]

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.comSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 46de5b81
...@@ -196,6 +196,10 @@ static void __init asm9260_timer_init(struct device_node *np) ...@@ -196,6 +196,10 @@ static void __init asm9260_timer_init(struct device_node *np)
panic("%s: unable to map resource", np->name); panic("%s: unable to map resource", np->name);
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