| .. | .. |
|---|
| 32 | 32 | #include <linux/sched.h> |
|---|
| 33 | 33 | #include <linux/slab.h> |
|---|
| 34 | 34 | #include <linux/suspend.h> |
|---|
| 35 | +#include <linux/units.h> |
|---|
| 35 | 36 | |
|---|
| 36 | 37 | #include "i2c-designware-core.h" |
|---|
| 37 | 38 | |
|---|
| 38 | 39 | static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev) |
|---|
| 39 | 40 | { |
|---|
| 40 | | - return clk_get_rate(dev->clk)/1000; |
|---|
| 41 | + return clk_get_rate(dev->clk) / KILO; |
|---|
| 41 | 42 | } |
|---|
| 42 | 43 | |
|---|
| 43 | 44 | #ifdef CONFIG_ACPI |
|---|
| .. | .. |
|---|
| 284 | 285 | |
|---|
| 285 | 286 | if (!dev->sda_hold_time && t->sda_hold_ns) |
|---|
| 286 | 287 | 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); |
|---|
| 288 | 289 | } |
|---|
| 289 | 290 | |
|---|
| 290 | 291 | adap = &dev->adapter; |
|---|