Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/exynos: use DIV_ROUND_CLOSEST to find the closest div

This patch uses DIV_ROUND_CLOSEST instead of DIV_ROUND_UP
The DIV_ROUND_CLOSEST can be used to find the closest integer
value when we divide some integers.

Signed-off-by: Chanho Park <chanho61.park@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

authored by

Chanho Park and committed by
Inki Dae
217fb00a 4e6319cd

+1 -1
+1 -1
drivers/gpu/drm/exynos/exynos_drm_fimd.c
··· 380 380 } 381 381 382 382 /* Find the clock divider value that gets us closest to ideal_clk */ 383 - clkdiv = DIV_ROUND_UP(clk_get_rate(ctx->lcd_clk), ideal_clk); 383 + clkdiv = DIV_ROUND_CLOSEST(clk_get_rate(ctx->lcd_clk), ideal_clk); 384 384 385 385 return (clkdiv < 0x100) ? clkdiv : 0xff; 386 386 }