Skip to content
Commit e7e7e0d7 authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Daniel Lezcano
Browse files

clocksource/drivers/sun5i: Fail gracefully when clock rate is unavailable

If the clock tree is not fully populated when the timer-sun5i init code
is called, attempts to get the clock rate for the timer would fail and
return 0.

Make the init code for both clock events and clocksource check the
returned clock rate and fail gracefully if the result is 0, instead of
causing a divide by 0 exception later on.

Fixes: 4a59058f

 ("clocksource/drivers/sun5i: Refactor the current code")
Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
Acked-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
parent 75b710af
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