Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21366831 authored by Linus Walleij's avatar Linus Walleij
Browse files

ARM: plat-nomadik: use DIV_ROUND_CLOSEST()



Use DIV_ROUND_CLOSEST() to calculate the cycle counter for the
periodic mode instead of relying on homebrew reimplementation.

Cc: Alessandro Rubini <rubini@unipv.it>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 0813069d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -201,7 +201,8 @@ void __init nmdk_timer_init(void __iomem *base, int irq)
		clk_prescale = MTU_CRn_PRESCALE_1;
	}

	nmdk_cycle = (rate + HZ/2) / HZ;
	/* Cycles for periodic mode */
	nmdk_cycle = DIV_ROUND_CLOSEST(rate, HZ);


	/* Timer 0 is the free running clocksource */