summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>2024-06-27 12:18:45 +0200
committerMark Brown <broonie@kernel.org>2024-07-02 15:27:03 +0200
commitf14a33fcadbacc1d9728e9c75253145ae6e09bbf (patch)
treec3460d41996b7ab6b345ff92b3888fbbab8ec7a6
parentASoC: topology: Correctly set shift_r in soc_tplg_denum_create() (diff)
downloadlinux-f14a33fcadbacc1d9728e9c75253145ae6e09bbf.tar.xz
linux-f14a33fcadbacc1d9728e9c75253145ae6e09bbf.zip
ASoC: topology: Align dynamic object initialization for controls
soc_tplg_dbytes_create() missed se->dobj.index initialization, so add it there. Additionally separate dynamic object initialization into separate logical block code. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Link: https://patch.msgid.link/20240627101850.2191513-9-amadeuszx.slawinski@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/soc-topology.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index e6eb514de569..72bd3823a015 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -677,10 +677,12 @@ static int soc_tplg_dbytes_create(struct soc_tplg *tplg, size_t size)
kc.access = le32_to_cpu(be->hdr.access);
sbe->max = le32_to_cpu(be->max);
+
+ INIT_LIST_HEAD(&sbe->dobj.list);
sbe->dobj.type = SND_SOC_DOBJ_BYTES;
+ sbe->dobj.index = tplg->index;
if (tplg->ops)
sbe->dobj.unload = tplg->ops->control_unload;
- INIT_LIST_HEAD(&sbe->dobj.list);
/* map io handlers */
ret = soc_tplg_kcontrol_bind_io(&be->hdr, &kc, tplg);
@@ -750,11 +752,12 @@ static int soc_tplg_dmixer_create(struct soc_tplg *tplg, size_t size)
sm->min = le32_to_cpu(mc->min);
sm->invert = le32_to_cpu(mc->invert);
sm->platform_max = le32_to_cpu(mc->platform_max);
- sm->dobj.index = tplg->index;
+
+ INIT_LIST_HEAD(&sm->dobj.list);
sm->dobj.type = SND_SOC_DOBJ_MIXER;
+ sm->dobj.index = tplg->index;
if (tplg->ops)
sm->dobj.unload = tplg->ops->control_unload;
- INIT_LIST_HEAD(&sm->dobj.list);
/* map io handlers */
ret = soc_tplg_kcontrol_bind_io(&mc->hdr, &kc, tplg);
@@ -894,11 +897,12 @@ static int soc_tplg_denum_create(struct soc_tplg *tplg, size_t size)
SNDRV_CHMAP_FR);
se->mask = le32_to_cpu(ec->mask);
- se->dobj.index = tplg->index;
+
+ INIT_LIST_HEAD(&se->dobj.list);
se->dobj.type = SND_SOC_DOBJ_ENUM;
+ se->dobj.index = tplg->index;
if (tplg->ops)
se->dobj.unload = tplg->ops->control_unload;
- INIT_LIST_HEAD(&se->dobj.list);
switch (le32_to_cpu(ec->hdr.ops.info)) {
case SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE: