Skip to content

Commit

Permalink
drm/exynos: use DIV_ROUND_CLOSEST to find the closest div
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chanho Park authored and Inki Dae committed Mar 1, 2016
1 parent 4e6319c commit 217fb00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_drm_fimd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 217fb00

Please sign in to comment.