aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clocksource/timer-sun5i.c')
-rw-r--r--drivers/clocksource/timer-sun5i.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/clocksource/timer-sun5i.c b/drivers/clocksource/timer-sun5i.c
index 3b56ea3f52af..552c5254390c 100644
--- a/drivers/clocksource/timer-sun5i.c
+++ b/drivers/clocksource/timer-sun5i.c
@@ -202,6 +202,11 @@ static int __init sun5i_setup_clocksource(struct device_node *node,
202 } 202 }
203 203
204 rate = clk_get_rate(clk); 204 rate = clk_get_rate(clk);
205 if (!rate) {
206 pr_err("Couldn't get parent clock rate\n");
207 ret = -EINVAL;
208 goto err_disable_clk;
209 }
205 210
206 cs->timer.base = base; 211 cs->timer.base = base;
207 cs->timer.clk = clk; 212 cs->timer.clk = clk;
@@ -275,6 +280,11 @@ static int __init sun5i_setup_clockevent(struct device_node *node, void __iomem
275 } 280 }
276 281
277 rate = clk_get_rate(clk); 282 rate = clk_get_rate(clk);
283 if (!rate) {
284 pr_err("Couldn't get parent clock rate\n");
285 ret = -EINVAL;
286 goto err_disable_clk;
287 }
278 288
279 ce->timer.base = base; 289 ce->timer.base = base;
280 ce->timer.ticks_per_jiffy = DIV_ROUND_UP(rate, HZ); 290 ce->timer.ticks_per_jiffy = DIV_ROUND_UP(rate, HZ);