Skip to contentSkip to conversation

ALSA: hda: cs35l56: Set the init_done flag before component_add()

PATCH Applied Richard Fitzgerald 2 participants 2 messages Mar 25, 2024 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda: cs35l56: Set the init_done flag before component_add()

From: Simon Trimmer <[email protected]>

Initialization is completed before adding the component as that can start the process of the device binding and trigger actions that check init_done.

Fixes 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier")
---
 sound/pci/hda/cs35l56_hda.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/hda/cs35l56_hda.c +2 -2
index f3c5715f5e02..1a3f84599cb5 100644
@@ -1045,14 +1045,14 @@ int cs35l56_hda_common_probe(struct cs35l56_hda *cs35l56, int hid, int id)
 	pm_runtime_mark_last_busy(cs35l56->base.dev);
 	pm_runtime_enable(cs35l56->base.dev);
 
+	cs35l56->base.init_done = true;
+
 	ret = component_add(cs35l56->base.dev, &cs35l56_hda_comp_ops);
 	if (ret) {
 		dev_err(cs35l56->base.dev, "Register component failed: %d\n", ret);
 		goto pm_err;
 	}
 
-	cs35l56->base.init_done = true;
-
 	return 0;
 
 pm_err:
Signature · 1 line
2.39.2