summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2023-06-01 15:25:32 +0200
committerWolfram Sang <wsa@kernel.org>2023-06-09 17:30:47 +0200
commitc21a17b5ce6e1a2e8de2f027a9a98db3cb96c428 (patch)
tree140f9455fd46ffd5cb5c0e3621fe798f6d802585 /drivers
parenti2c: Add i2c_get_match_data() (diff)
downloadlinux-c21a17b5ce6e1a2e8de2f027a9a98db3cb96c428.tar.xz
linux-c21a17b5ce6e1a2e8de2f027a9a98db3cb96c428.zip
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 <u.kleine-koenig@pengutronix.de> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-imx-lpi2c.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index 48e695880d0a..f8fa80203902 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -217,7 +217,7 @@ static int lpi2c_imx_config(struct lpi2c_imx_struct *lpi2c_imx)
for (prescale = 0; prescale <= 7; prescale++) {
clk_cycle = clk_rate / ((1 << prescale) * lpi2c_imx->bitrate)
- 3 - (filt >> 1);
- clkhi = (clk_cycle + I2C_CLK_RATIO) / (I2C_CLK_RATIO + 1);
+ clkhi = DIV_ROUND_UP(clk_cycle, I2C_CLK_RATIO + 1);
clklo = clk_cycle - clkhi;
if (clklo < 64)
break;