Skip to content

Commit cad9720

Browse files
arndbbroonie
authored andcommitted
ASoC: sophgo: fix 64-bit division build failure
cv1800b_adc_setbclk_div() does four 64-bit divisions in a row, which is rather inefficient on 32-bit systems, and using the plain division causes a build failure as a result: ERROR: modpost: "__aeabi_uldivmod" [sound/soc/sophgo/cv1800b-sound-adc.ko] undefined! Consolidate those into a single division using the div_u64() macro. Fixes: 4cf8752 ("ASoC: sophgo: add CV1800B internal ADC codec driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://patch.msgid.link/20260202095323.1233553-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 1db63f6 commit cad9720

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

sound/soc/sophgo/cv1800b-sound-adc.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,8 @@ static int cv1800b_adc_setbclk_div(struct cv1800b_priv *priv, unsigned int rate)
105105
if (!priv->mclk_rate || !rate)
106106
return -EINVAL;
107107

108-
tmp = priv->mclk_rate;
109-
tmp /= CV1800B_RXADC_WORD_LEN;
110-
tmp /= CV1800B_RXADC_CHANNELS;
111-
tmp /= rate;
112-
tmp /= 2;
108+
tmp = div_u64(priv->mclk_rate, CV1800B_RXADC_WORD_LEN *
109+
CV1800B_RXADC_CHANNELS * rate * 2);
113110

114111
if (!tmp) {
115112
dev_err(priv->dev, "computed BCLK divider is zero\n");

0 commit comments

Comments
 (0)