Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: loongson: fix compile testing on 32-bit

DIV_ROUND_CLOSEST() does not work on 64-bit variables when building for
a 32-bit target:

ld.lld: error: undefined symbol: __udivdi3
>>> referenced by loongson_i2s.c
>>> sound/soc/loongson/loongson_i2s.o:(loongson_i2s_hw_params) in archive vmlinux.a

Use DIV_ROUND_CLOSEST_ULL() instead.

Fixes: d24028606e764 ("ASoC: loongson: Add Loongson ASoC Sound Card Support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20230616090156.2347850-4-arnd@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Arnd Bergmann and committed by
Mark Brown
928314eb 08432e59

+1 -1
+1 -1
sound/soc/loongson/loongson_i2s.c
··· 89 89 bclk_ratio = DIV_ROUND_CLOSEST(sysclk, 90 90 (bits * chans * fs * 2)) - 1; 91 91 mclk_ratio = clk_rate / sysclk; 92 - mclk_ratio_frac = DIV_ROUND_CLOSEST(((u64)clk_rate << 16), 92 + mclk_ratio_frac = DIV_ROUND_CLOSEST_ULL(((u64)clk_rate << 16), 93 93 sysclk) - (mclk_ratio << 16); 94 94 95 95 regmap_read(i2s->regmap, LS_I2S_CFG, &val);