hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/drivers/i2c/busses/i2c-designware-platdrv.c
....@@ -32,12 +32,13 @@
3232 #include <linux/sched.h>
3333 #include <linux/slab.h>
3434 #include <linux/suspend.h>
35
+#include <linux/units.h>
3536
3637 #include "i2c-designware-core.h"
3738
3839 static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev)
3940 {
40
- return clk_get_rate(dev->clk)/1000;
41
+ return clk_get_rate(dev->clk) / KILO;
4142 }
4243
4344 #ifdef CONFIG_ACPI
....@@ -284,7 +285,7 @@
284285
285286 if (!dev->sda_hold_time && t->sda_hold_ns)
286287 dev->sda_hold_time =
287
- div_u64(clk_khz * t->sda_hold_ns + 500000, 1000000);
288
+ DIV_S64_ROUND_CLOSEST(clk_khz * t->sda_hold_ns, MICRO);
288289 }
289290
290291 adap = &dev->adapter;