Skip to content

Commit c21a17b

Browse files
Uwe Kleine-Königwsakernel
authored andcommitted
i2c: imx-lpi2c: Don't open-code DIV_ROUND_UP
There is no change in the generated code (tested on an ARCH=arm allmodconfig build). Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 564d73c commit c21a17b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/i2c/busses/i2c-imx-lpi2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ static int lpi2c_imx_config(struct lpi2c_imx_struct *lpi2c_imx)
217217
for (prescale = 0; prescale <= 7; prescale++) {
218218
clk_cycle = clk_rate / ((1 << prescale) * lpi2c_imx->bitrate)
219219
- 3 - (filt >> 1);
220-
clkhi = (clk_cycle + I2C_CLK_RATIO) / (I2C_CLK_RATIO + 1);
220+
clkhi = DIV_ROUND_UP(clk_cycle, I2C_CLK_RATIO + 1);
221221
clklo = clk_cycle - clkhi;
222222
if (clklo < 64)
223223
break;

0 commit comments

Comments
 (0)