diff mbox series

[3/4] ALSA: hda: Always free codec on the device release

Message ID 20220720130622.146973-4-cezary.rojewski@intel.com (mailing list archive)
State Superseded
Headers show
Series ALSA: hda: Unify codec construction | expand

Commit Message

Cezary Rojewski July 20, 2022, 1:06 p.m. UTC
With all HDAudio drivers aligned to make use of the same constructor,
have codec freed on the device release regardless of its type.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 sound/pci/hda/hda_codec.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 7b2e62fa82d5..44395b1b734b 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -883,13 +883,7 @@  static void snd_hda_codec_dev_release(struct device *dev)
 	snd_hda_sysfs_clear(codec);
 	kfree(codec->modelname);
 	kfree(codec->wcaps);
-
-	/*
-	 * In the case of ASoC HD-audio, hda_codec is device managed.
-	 * It will be freed when the ASoC device is removed.
-	 */
-	if (codec->core.type == HDA_DEV_LEGACY)
-		kfree(codec);
+	kfree(codec);
 }
 
 #define DEV_NAME_LEN 31