i2c: mlxbf: avoid 64-bit division
authorArnd Bergmann <arnd@arndb.de>
Tue, 20 May 2025 15:25:45 +0000 (17:25 +0200)
committerAndi Shyti <andi@smida.it>
Fri, 23 May 2025 08:02:27 +0000 (10:02 +0200)
commit2b2805404c926b8dcd5c5c13d240722da714906e
tree98f3444daeb2e92d0be07e1794b6cd8c0cd66d8f
parent3b7d8d151a7ebebc5257766110c102ab173b5844
i2c: mlxbf: avoid 64-bit division

The 64-bit division in mlxbf_i2c_get_ticks() causes link failures
when compile-testing on 32-bit machines:

ERROR: modpost: "__udivdi3" [drivers/i2c/busses/i2c-mlxbf.ko] undefined!

Change this to a div_u64(), which should replace the constant division
with a a multiply/shift combination in the mlxbf_i2c_get_ticks().

The frequency calculation functions require a slow library call but
should be used much rarer.

Fixes: 053859002c20 ("i2c: mlxbf: Allow build with COMPILE_TEST")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20250520152600.1975628-1-arnd@kernel.org
Signed-off-by: Andi Shyti <andi@smida.it>
drivers/i2c/busses/i2c-mlxbf.c