]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: Intel: avs: Update hda component teardown sequences
authorCezary Rojewski <cezary.rojewski@intel.com>
Thu, 9 Jan 2025 12:22:08 +0000 (13:22 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 9 Jan 2025 12:14:20 +0000 (12:14 +0000)
If case of failure cleanup recently created DAI and while at it, adjust
the remove() operation to match operation order of the probe() function.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20250109122216.3667847-6-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/avs/pcm.c

index 945f9c0a6a5455c5ffec7bdbce892e862418bcc2..5878cfdbbee50f73d65617562a63b9fb540b50ea 100644 (file)
@@ -1564,6 +1564,7 @@ static int avs_component_hda_probe(struct snd_soc_component *component)
                if (ret < 0) {
                        dev_err(component->dev, "create widgets failed: %d\n",
                                ret);
+                       snd_soc_unregister_dai(dai);
                        goto exit;
                }
        }
@@ -1578,8 +1579,8 @@ exit:
 
 static void avs_component_hda_remove(struct snd_soc_component *component)
 {
-       avs_component_hda_unregister_dais(component);
        avs_component_remove(component);
+       avs_component_hda_unregister_dais(component);
 }
 
 static int avs_component_hda_open(struct snd_soc_component *component,