]> www.infradead.org Git - users/willy/xarray.git/commitdiff
i2c: designware: Use better constants from units.h
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 16 Apr 2025 10:17:02 +0000 (13:17 +0300)
committerAndi Shyti <andi@smida.it>
Mon, 19 May 2025 20:23:55 +0000 (22:23 +0200)
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>
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Acked-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>
Link: https://lore.kernel.org/r/20250416101702.2128740-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
drivers/i2c/busses/i2c-designware-platdrv.c

index d6e1ee935399d7a04feb2e5dce240d927d257b8f..879719e91df2a5af9d753c8a3a49871b5b29c90d 100644 (file)
@@ -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