summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2016-02-11 23:11:20 +0900
committerInki Dae <daeinki@gmail.com>2016-03-01 23:37:21 +0900
commit217fb00a7947a4ac0da15ab7a32d2aeb2fa5539a (patch)
tree035ad59b145618e1235a7414de9ee1bddc4d95dc
parent4e6319cd52034ff3cc140213122f2265fc27719c (diff)
downloadlinux-217fb00a7947a4ac0da15ab7a32d2aeb2fa5539a.tar.bz2
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>
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fimd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
index 70194d0e4fe4..11616dfbc709 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c
@@ -380,7 +380,7 @@ static u32 fimd_calc_clkdiv(struct fimd_context *ctx,
}
/* Find the clock divider value that gets us closest to ideal_clk */
- clkdiv = DIV_ROUND_UP(clk_get_rate(ctx->lcd_clk), ideal_clk);
+ clkdiv = DIV_ROUND_CLOSEST(clk_get_rate(ctx->lcd_clk), ideal_clk);
return (clkdiv < 0x100) ? clkdiv : 0xff;
}