1 From 9b77fc0a588ce69894b36d88bbf5540d3f796452 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Mon, 25 Mar 2024 14:55:10 +0000
4 Subject: ALSA: hda: cs35l56: Set the init_done flag before component_add()
6 From: Simon Trimmer <simont@opensource.cirrus.com>
8 [ Upstream commit cafe9c6a72cf1ffe96d2561d988a141cb5c093db ]
10 Initialization is completed before adding the component as that can
11 start the process of the device binding and trigger actions that check
14 Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
15 Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
16 Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier")
17 Message-ID: <20240325145510.328378-1-rf@opensource.cirrus.com>
18 Signed-off-by: Takashi Iwai <tiwai@suse.de>
19 Signed-off-by: Sasha Levin <sashal@kernel.org>
21 sound/pci/hda/cs35l56_hda.c | 4 ++--
22 1 file changed, 2 insertions(+), 2 deletions(-)
24 diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c
25 index 7adc1d373d65c..27848d6469636 100644
26 --- a/sound/pci/hda/cs35l56_hda.c
27 +++ b/sound/pci/hda/cs35l56_hda.c
28 @@ -978,14 +978,14 @@ int cs35l56_hda_common_probe(struct cs35l56_hda *cs35l56, int id)
29 pm_runtime_mark_last_busy(cs35l56->base.dev);
30 pm_runtime_enable(cs35l56->base.dev);
32 + cs35l56->base.init_done = true;
34 ret = component_add(cs35l56->base.dev, &cs35l56_hda_comp_ops);
36 dev_err(cs35l56->base.dev, "Register component failed: %d\n", ret);
40 - cs35l56->base.init_done = true;