diff mbox series

ASoC: codecs/hda.c: use devm_snd_soc_register_dai()

Message ID 87tttjpsv5.wl-kuninori.morimoto.gx@renesas.com
State New
Headers show
Series ASoC: codecs/hda.c: use devm_snd_soc_register_dai() | expand

Commit Message

Kuninori Morimoto July 31, 2023, 11:24 p.m. UTC
It is still using snd_soc_{un}register_dai() manually.
Let's use devm_snd_soc_register_dai().

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/codecs/hda.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/codecs/hda.c b/sound/soc/codecs/hda.c
index d57b043d6bfe..551bd0cbfc44 100644
--- a/sound/soc/codecs/hda.c
+++ b/sound/soc/codecs/hda.c
@@ -99,7 +99,7 @@  static int hda_codec_register_dais(struct hda_codec *codec, struct snd_soc_compo
 	list_for_each_entry(pcm, &codec->pcm_list_head, list) {
 		struct snd_soc_dai *dai;
 
-		dai = snd_soc_register_dai(component, drvs, false);
+		dai = devm_snd_soc_register_dai(component->dev, component, drvs, false);
 		if (!dai) {
 			dev_err(component->dev, "register dai for %s failed\n", pcm->name);
 			return -EINVAL;
@@ -108,7 +108,6 @@  static int hda_codec_register_dais(struct hda_codec *codec, struct snd_soc_compo
 		ret = snd_soc_dapm_new_dai_widgets(dapm, dai);
 		if (ret < 0) {
 			dev_err(component->dev, "create widgets failed: %d\n", ret);
-			snd_soc_unregister_dai(dai);
 			return ret;
 		}
 
@@ -135,7 +134,6 @@  static void hda_codec_unregister_dais(struct hda_codec *codec,
 			for_each_pcm_streams(stream)
 				snd_soc_dapm_free_widget(snd_soc_dai_get_widget(dai, stream));
 
-			snd_soc_unregister_dai(dai);
 			break;
 		}
 	}