From: Dan Carpenter Date: Sat, 20 Dec 2025 08:45:40 +0000 (+0300) Subject: ASoC: rt1320: Fix retry checking in rt1320_rae_load() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6bca73d699cfe00d3419566fdb2a45e112f44b0;p=thirdparty%2Fkernel%2Flinux.git ASoC: rt1320: Fix retry checking in rt1320_rae_load() This loop iterates 200 times and then gives up. The problem is that currently the loop exits with "retry" set to -1 on the failure path but the check for failure expects it to be 0. Change from a post-op to a pre-op so that it exits with "retry" set to 0. Fixes: 22937af75abb ("ASoC: rt1320: support RAE parameters loading") Signed-off-by: Dan Carpenter Acked-by: Shuming Fan Link: https://patch.msgid.link/aUZiNJ7pzuahXFYE@stanley.mountain Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/rt1320-sdw.c b/sound/soc/codecs/rt1320-sdw.c index 00eb792048356..e1c4a1adacff4 100644 --- a/sound/soc/codecs/rt1320-sdw.c +++ b/sound/soc/codecs/rt1320-sdw.c @@ -1478,7 +1478,7 @@ static int rt1320_rae_load(struct rt1320_sdw_priv *rt1320) /* RAE stop & CRC disable */ regmap_update_bits(rt1320->regmap, 0xe803, 0xbc, 0x00); - while (retry--) { + while (--retry) { regmap_read(rt1320->regmap, 0xe83f, &value); if (value & 0x40) break;