]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
clocksource/drivers/renesas-ostm: Use DIV_ROUND_CLOSEST() helper
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 7 Aug 2019 08:46:33 +0000 (10:46 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 26 Aug 2019 22:31:39 +0000 (00:31 +0200)
Use the DIV_ROUND_CLOSEST() helper instead of open-coding the same
operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/clocksource/renesas-ostm.c

index 61d5f3b539ce23df60f43bc914fb8a45e915202a..37c39b901bb12b38e2d6bf2d6c69848ed4b12efd 100644 (file)
@@ -221,7 +221,7 @@ static int __init ostm_init(struct device_node *np)
        }
 
        rate = clk_get_rate(ostm_clk);
-       ostm->ticks_per_jiffy = (rate + HZ / 2) / HZ;
+       ostm->ticks_per_jiffy = DIV_ROUND_CLOSEST(rate, HZ);
 
        /*
         * First probed device will be used as system clocksource. Any