Skip to content

Commit

Permalink
i2c: hisi: use HZ_PER_KHZ macro in units.h
Browse files Browse the repository at this point in the history
HZ macros has been centralized in units.h since [1]. Use it to avoid
duplicated definition.

[1] commit e2c7703 ("units: add the HZ macros")

Signed-off-by: Yicong Yang <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
  • Loading branch information
Yicong Yang authored and wsakernel committed Jun 15, 2022
1 parent 4c0ad47 commit 4dc1372
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/i2c/busses/i2c-hisi.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/units.h>

#define HISI_I2C_FRAME_CTRL 0x0000
#define HISI_I2C_FRAME_CTRL_SPEED_MODE GENMASK(1, 0)
Expand Down Expand Up @@ -80,8 +81,6 @@
#define HISI_I2C_TX_F_AE_THRESH 1
#define HISI_I2C_RX_F_AF_THRESH 60

#define HZ_PER_KHZ 1000

#define NSEC_TO_CYCLES(ns, clk_rate_khz) \
DIV_ROUND_UP_ULL((clk_rate_khz) * (ns), NSEC_PER_MSEC)

Expand Down

0 comments on commit 4dc1372

Please sign in to comment.