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

ASoC: cs35l41: Initialize completion object before requesting IRQ

Technically, an interrupt handler can be called before probe() finishes
its execution, hence ensure the pll_lock completion object is always
initialized before being accessed in cs35l41_irq().

Fixes: f5030564938b ("ALSA: cs35l41: Add shared boost feature")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-4-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Cristian Ciocaltea and committed by
Mark Brown
5ad668a9 4bb5870a

+2 -2
+2 -2
sound/soc/codecs/cs35l41.c
··· 1273 1273 regmap_update_bits(cs35l41->regmap, CS35L41_IRQ1_MASK3, CS35L41_INT3_PLL_LOCK_MASK, 1274 1274 0 << CS35L41_INT3_PLL_LOCK_SHIFT); 1275 1275 1276 + init_completion(&cs35l41->pll_lock); 1277 + 1276 1278 ret = devm_request_threaded_irq(cs35l41->dev, cs35l41->irq, NULL, cs35l41_irq, 1277 1279 IRQF_ONESHOT | IRQF_SHARED | irq_pol, 1278 1280 "cs35l41", cs35l41); ··· 1296 1294 ret = cs35l41_dsp_init(cs35l41); 1297 1295 if (ret < 0) 1298 1296 goto err; 1299 - 1300 - init_completion(&cs35l41->pll_lock); 1301 1297 1302 1298 pm_runtime_set_autosuspend_delay(cs35l41->dev, 3000); 1303 1299 pm_runtime_use_autosuspend(cs35l41->dev);