diff options
author | Mark Brown <broonie@kernel.org> | 2021-02-05 16:01:21 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-02-05 16:01:21 +0100 |
commit | 2927e6d398d0fca52d8f011a89dcfcabb2b1abfd (patch) | |
tree | 30ddd4cddded855db423c290512d7be7c13dc9db /sound/soc/soc-topology.c | |
parent | Merge series "ASoC: mediatek: mt8192: apply some cleanup" from Tzung-Bi Shih ... (diff) | |
parent | Merge series "ASoC: SOF/Intel/SoundWire: add missing quirks and DMIC support"... (diff) | |
download | linux-2927e6d398d0fca52d8f011a89dcfcabb2b1abfd.tar.xz linux-2927e6d398d0fca52d8f011a89dcfcabb2b1abfd.zip |
Merge branch 'asoc-5.11' into asoc-5.12
Diffstat (limited to 'sound/soc/soc-topology.c')
-rw-r--r-- | sound/soc/soc-topology.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 7a75ca77d3e7..1b0cd33a1348 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -447,7 +447,7 @@ static void remove_dai(struct snd_soc_component *comp, { struct snd_soc_dai_driver *dai_drv = container_of(dobj, struct snd_soc_dai_driver, dobj); - struct snd_soc_dai *dai; + struct snd_soc_dai *dai, *_dai; if (pass != SOC_TPLG_PASS_PCM_DAI) return; @@ -455,9 +455,9 @@ static void remove_dai(struct snd_soc_component *comp, if (dobj->ops && dobj->ops->dai_unload) dobj->ops->dai_unload(comp, dobj); - for_each_component_dais(comp, dai) + for_each_component_dais_safe(comp, dai, _dai) if (dai->driver == dai_drv) - dai->driver = NULL; + snd_soc_unregister_dai(dai); list_del(&dobj->list); } @@ -902,7 +902,7 @@ static int soc_tplg_denum_create_values(struct soc_tplg *tplg, struct soc_enum * return -EINVAL; se->dobj.control.dvalues = devm_kcalloc(tplg->dev, le32_to_cpu(ec->items), - sizeof(u32), + sizeof(*se->dobj.control.dvalues), GFP_KERNEL); if (!se->dobj.control.dvalues) return -ENOMEM; @@ -1742,7 +1742,7 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg, list_add(&dai_drv->dobj.list, &tplg->comp->dobj_list); /* register the DAI to the component */ - dai = devm_snd_soc_register_dai(tplg->dev, tplg->comp, dai_drv, false); + dai = snd_soc_register_dai(tplg->comp, dai_drv, false); if (!dai) return -ENOMEM; @@ -1750,6 +1750,7 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg, ret = snd_soc_dapm_new_dai_widgets(dapm, dai); if (ret != 0) { dev_err(dai->dev, "Failed to create DAI widgets %d\n", ret); + snd_soc_unregister_dai(dai); return ret; } |