diff mbox series

[SRU,R,v2,02/14] ASoC: SDCA: Fix bad move of jack_state initialisation

Message ID 20260826082456.892463-3-chris.chiu@canonical.com
State New
Headers show
Series Fix SDCA jack detection race and reprobe issues on Dell Slate Max platform with CirrusLogic audio solution | expand

Commit Message

Chris Chiu Aug. 26, 2026, 8:24 a.m. UTC
From: Charles Keepax <ckeepax@opensource.cirrus.com>

BugLink: https://bugs.launchpad.net/bugs/2163215

The initialisation of jack_state was accidentally moved until after its
use, correct this.

Fixes: cb3c257e0824 ("ASoC: SDCA: Add correct masks whilst reporting SDCA jack status")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260505090811.3697153-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit 36c543cc51008fbc9ebfaf1e58c34425b7997c88)
Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
---
 sound/soc/sdca/sdca_jack.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/sound/soc/sdca/sdca_jack.c b/sound/soc/sdca/sdca_jack.c
index a2d95b124b78..ae9636622a84 100644
--- a/sound/soc/sdca/sdca_jack.c
+++ b/sound/soc/sdca/sdca_jack.c
@@ -203,6 +203,8 @@  int sdca_jack_set_jack(struct sdca_interrupt_info *info, struct snd_soc_jack *ja
 			if (!range)
 				return -EINVAL;
 
+			jack_state = interrupt->priv;
+
 			for (j = 0; j < range->rows; j++) {
 				enum sdca_terminal_type type;
 
@@ -211,7 +213,6 @@  int sdca_jack_set_jack(struct sdca_interrupt_info *info, struct snd_soc_jack *ja
 				jack_state->mask |= type_get_mask(type);
 			}
 
-			jack_state = interrupt->priv;
 			jack_state->jack = jack;
 
 			/* Report initial state in case IRQ was already handled */