浏览代码

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>
Chanho Park 9 年之前
父节点
当前提交
217fb00a79
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/gpu/drm/exynos/exynos_drm_fimd.c

+ 1 - 1
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 */
 	/* 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;
 	return (clkdiv < 0x100) ? clkdiv : 0xff;
 }
 }