From: Yoichi Yuasa Date: Tue, 23 Oct 2007 09:22:50 +0000 (+0900) Subject: [MIPS] time: set clock before clockevent_delta2ns() in GT641xx. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=11c03a6faa471ae37f4fd3db79389ae6297b66db;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [MIPS] time: set clock before clockevent_delta2ns() in GT641xx. clockevent_delta2ns() use the shift and mult value, so clockevent_set_clock() should be called first. Pointed out by Atsushi Nemoto. Signed-off-by: Yoichi Yuasa Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/kernel/cevt-gt641xx.c b/arch/mips/kernel/cevt-gt641xx.c index 155ef81ec216..c36772631fe0 100644 --- a/arch/mips/kernel/cevt-gt641xx.c +++ b/arch/mips/kernel/cevt-gt641xx.c @@ -131,9 +131,9 @@ static int __init gt641xx_timer0_clockevent_init(void) cd = >641xx_timer0_clockevent; cd->rating = 200 + gt641xx_base_clock / 10000000; + clockevent_set_clock(cd, gt641xx_base_clock); cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd); cd->min_delta_ns = clockevent_delta2ns(0x300, cd); - clockevent_set_clock(cd, gt641xx_base_clock); clockevents_register_device(>641xx_timer0_clockevent);