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: 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 <dan.carpenter@linaro.org>
Acked-by: Shuming Fan <shumingf@realtek.com>
Link: https://patch.msgid.link/aUZiNJ7pzuahXFYE@stanley.mountain
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Dan Carpenter and committed by
Mark Brown
c6bca73d 9e692bb5

+1 -1
+1 -1
sound/soc/codecs/rt1320-sdw.c
··· 1478 1478 /* RAE stop & CRC disable */ 1479 1479 regmap_update_bits(rt1320->regmap, 0xe803, 0xbc, 0x00); 1480 1480 1481 - while (retry--) { 1481 + while (--retry) { 1482 1482 regmap_read(rt1320->regmap, 0xe83f, &value); 1483 1483 if (value & 0x40) 1484 1484 break;