Skip to content

Commit 8fc7cc5

Browse files
jwrdegoedebroonie
authored andcommitted
ASoC: rt5640: Only cancel jack-detect work on suspend if active
If jack-detection is not used; or has already been disabled then there is no need to call rt5640_cancel_work(). Move the rt5640_cancel_work() inside the "if (rt5640->jack) {}" block, grouping it together with the disabling of the IRQ which queues the work in the first place. This also makes suspend() symetrical with resume() which re-queues the work in an "if (rt5640->jack) {}" block. Cc: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20230912113245.320159-7-hdegoede@redhat.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 8c8bf3d commit 8fc7cc5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/soc/codecs/rt5640.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2801,9 +2801,9 @@ static int rt5640_suspend(struct snd_soc_component *component)
28012801
if (rt5640->jack) {
28022802
/* disable jack interrupts during system suspend */
28032803
disable_irq(rt5640->irq);
2804+
rt5640_cancel_work(rt5640);
28042805
}
28052806

2806-
rt5640_cancel_work(rt5640);
28072807
snd_soc_component_force_bias_level(component, SND_SOC_BIAS_OFF);
28082808
rt5640_reset(component);
28092809
regcache_cache_only(rt5640->regmap, true);

0 commit comments

Comments
 (0)