aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-topology.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/soc-topology.c')
-rw-r--r--sound/soc/soc-topology.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 65670b2b408c..002772e3ba2c 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -344,7 +344,7 @@ static int soc_tplg_widget_load(struct soc_tplg *tplg,
return 0;
}
-/* pass DAI configurations to component driver for extra intialization */
+/* pass DAI configurations to component driver for extra initialization */
static int soc_tplg_dai_load(struct soc_tplg *tplg,
struct snd_soc_dai_driver *dai_drv)
{
@@ -354,7 +354,7 @@ static int soc_tplg_dai_load(struct soc_tplg *tplg,
return 0;
}
-/* pass link configurations to component driver for extra intialization */
+/* pass link configurations to component driver for extra initialization */
static int soc_tplg_dai_link_load(struct soc_tplg *tplg,
struct snd_soc_dai_link *link)
{
@@ -495,12 +495,13 @@ static void remove_widget(struct snd_soc_component *comp,
struct snd_kcontrol *kcontrol = w->kcontrols[i];
struct soc_enum *se =
(struct soc_enum *)kcontrol->private_value;
+ int j;
snd_ctl_remove(card, kcontrol);
kfree(se->dobj.control.dvalues);
- for (i = 0; i < se->items; i++)
- kfree(se->dobj.control.dtexts[i]);
+ for (j = 0; j < se->items; j++)
+ kfree(se->dobj.control.dtexts[j]);
kfree(se);
}
@@ -514,13 +515,12 @@ static void remove_widget(struct snd_soc_component *comp,
== SND_SOC_TPLG_TYPE_MIXER)
kfree(kcontrol->tlv.p);
- snd_ctl_remove(card, kcontrol);
-
/* Private value is used as struct soc_mixer_control
* for volume mixers or soc_bytes_ext for bytes
* controls.
*/
kfree((void *)kcontrol->private_value);
+ snd_ctl_remove(card, kcontrol);
}
kfree(w->kcontrol_news);
}
@@ -934,6 +934,7 @@ static int soc_tplg_denum_create_texts(struct soc_enum *se,
}
}
+ se->texts = (const char * const *)se->dobj.control.dtexts;
return 0;
err:
@@ -1556,6 +1557,15 @@ widget:
widget = snd_soc_dapm_new_control(dapm, &template);
else
widget = snd_soc_dapm_new_control_unlocked(dapm, &template);
+ if (IS_ERR(widget)) {
+ ret = PTR_ERR(widget);
+ /* Do not nag about probe deferrals */
+ if (ret != -EPROBE_DEFER)
+ dev_err(tplg->dev,
+ "ASoC: failed to create widget %s controls (%d)\n",
+ w->name, ret);
+ goto hdr_err;
+ }
if (widget == NULL) {
dev_err(tplg->dev, "ASoC: failed to create widget %s controls\n",
w->name);
@@ -1863,7 +1873,7 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg,
{
struct snd_soc_tplg_pcm *pcm, *_pcm;
int count = hdr->count;
- int i, err;
+ int i;
bool abi_match;
if (tplg->pass != SOC_TPLG_PASS_PCM_DAI)
@@ -1897,7 +1907,7 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg,
_pcm = pcm;
} else {
abi_match = false;
- err = pcm_new_ver(tplg, pcm, &_pcm);
+ pcm_new_ver(tplg, pcm, &_pcm);
}
/* create the FE DAIs and DAI links */
@@ -1919,7 +1929,7 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg,
/**
* set_link_hw_format - Set the HW audio format of the physical DAI link.
- * @tplg: topology context
+ * @link: &snd_soc_dai_link which should be updated
* @cfg: physical link configs.
*
* Topology context contains a list of supported HW formats (configs) and
@@ -1970,7 +1980,7 @@ static void set_link_hw_format(struct snd_soc_dai_link *link,
/**
* link_new_ver - Create a new physical link config from the old
* version of source.
- * @toplogy: topology context
+ * @tplg: topology context
* @src: old version of phyical link config as a source
* @link: latest version of physical link config created from the source
*
@@ -2212,7 +2222,7 @@ static int soc_tplg_dai_elems_load(struct soc_tplg *tplg,
/**
* manifest_new_ver - Create a new version of manifest from the old version
* of source.
- * @toplogy: topology context
+ * @tplg: topology context
* @src: old version of manifest as a source
* @manifest: latest version of manifest created from the source
*