Skip to content

Commit

Permalink
clocksource/drivers/renesas-ostm: Use DIV_ROUND_CLOSEST() helper
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Geert Uytterhoeven authored and Daniel Lezcano committed Aug 26, 2019
1 parent 24e8a5d commit 8d18f6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clocksource/renesas-ostm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8d18f6f

Please sign in to comment.