]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
i2c: mlxbf: Use HZ_PER_GHZ constant instead of custom one
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 12 Jan 2026 13:46:10 +0000 (14:46 +0100)
committerAndi Shyti <andi.shyti@kernel.org>
Tue, 13 Jan 2026 17:33:41 +0000 (18:33 +0100)
Use HZ_PER_GHZ constant instead of custom one. No functional changes.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260112134900.4142954-3-andriy.shevchenko@linux.intel.com
drivers/i2c/busses/i2c-mlxbf.c

index 8345f7e6385df64bcd3a82021df3f1e04524c6c5..746f6598913802f0f8527436d54ce1c1f82425f6 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/platform_device.h>
 #include <linux/string.h>
 #include <linux/string_choices.h>
+#include <linux/units.h>
 
 /* Defines what functionality is present. */
 #define MLXBF_I2C_FUNC_SMBUS_BLOCK \
@@ -72,8 +73,6 @@
 /* Constant used to determine the PLL frequency. */
 #define MLNXBF_I2C_COREPLL_CONST    16384ULL
 
-#define MLXBF_I2C_FREQUENCY_1GHZ  1000000000ULL
-
 /* PLL registers. */
 #define MLXBF_I2C_CORE_PLL_REG1         0x4
 #define MLXBF_I2C_CORE_PLL_REG2         0x8
@@ -1083,7 +1082,7 @@ static u32 mlxbf_i2c_get_ticks(struct mlxbf_i2c_priv *priv, u64 nanoseconds,
         *         Frequency
         */
        frequency = priv->frequency;
-       ticks = div_u64(nanoseconds * frequency, MLXBF_I2C_FREQUENCY_1GHZ);
+       ticks = div_u64(nanoseconds * frequency, HZ_PER_GHZ);
        /*
         * The number of ticks is rounded down and if minimum is equal to 1
         * then add one tick.