Re: [PATCH v1 1/1] i2c: designware: Use better constants from units.h

Mukesh Kumar Savaliya
2025-04-16T12:19:53Z

On 4/16/2025 3:47 PM, Andy Shevchenko wrote:
> When we use constants in a time or frequency related contexts,
> it's better to utilise the respective definitions that have
> encoded units in them. This will make code better to read and
> understand.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index d6e1ee935399..879719e91df2 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -34,7 +34,7 @@
>
> static u32 i2c_dw_get_clk_rate_khz(struct dw_i2c_dev *dev)
> {
> - return clk_get_rate(dev->clk) / KILO;
> + return clk_get_rate(dev->clk) / HZ_PER_KHZ;
> }
>
> #ifdef CONFIG_OF
Acked-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>