[PATCH 1/3] clk: microchip: core: update to use div64_ul() instead of do_div()
From: Brian Masney
Date: Sun Feb 22 2026 - 18:51:42 EST
This driver is currently only compiled on 32-bit MIPS systems. When
compiling on 64-bit systems, the build fails with:
WARNING: do_div() does a 64-by-32 division, please consider using
div64_ul instead.
Let's update this to use div64_ul() in preparation for allowing this
driver to be compiled on all architectures.
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202601160758.bpkN4546-lkp@xxxxxxxxx/
Signed-off-by: Brian Masney <bmasney@xxxxxxxxxx>
---
drivers/clk/microchip/clk-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/microchip/clk-core.c b/drivers/clk/microchip/clk-core.c
index 692152b5094e00bf5acb19a67cf41e6c86b11f35..2e86ad846a66cd5487f5412c09ab0ad25ebe3f79 100644
--- a/drivers/clk/microchip/clk-core.c
+++ b/drivers/clk/microchip/clk-core.c
@@ -341,7 +341,7 @@ static void roclk_calc_div_trim(unsigned long rate,
div = parent_rate / (rate << 1);
frac = parent_rate;
frac <<= 8;
- do_div(frac, rate);
+ frac = div64_ul(frac, rate);
frac -= (u64)(div << 9);
rodiv = (div > REFO_DIV_MASK) ? REFO_DIV_MASK : div;
--
2.53.0