diff options
author | Chuhong Yuan <hslester96@gmail.com> | 2019-10-16 20:43:30 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-04 13:34:27 +0100 |
commit | d0eba4f1059ca1b99ad2e8eded69d7b3bb0e8116 (patch) | |
tree | d9ffa60b8382b9d5b71f859817071b425dbcf40b | |
parent | b1fae4cc3142cec3842e919b3648b2213f9905c5 (diff) |
clocksource/drivers/asm9260: Add a check for of_clk_get
[ Upstream commit 6e001f6a4cc73cd06fc7b8c633bc4906c33dd8ad ]
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 <hslester96@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20191016124330.22211-1-hslester96@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/clocksource/asm9260_timer.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/clocksource/asm9260_timer.c b/drivers/clocksource/asm9260_timer.c index 217438d39eb3..38a28240f84f 100644 --- a/drivers/clocksource/asm9260_timer.c +++ b/drivers/clocksource/asm9260_timer.c @@ -196,6 +196,10 @@ static void __init asm9260_timer_init(struct device_node *np) panic("%s: unable to map resource", np->name); 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); if (ret) |