[PATCH 3/8] ASoC: SOF: topology: remove unnecessary memory alloc for sdev->private
Pierre-Louis Bossart
pierre-louis.bossart at linux.intel.com
Mon Aug 24 22:09:07 CEST 2020
From: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
Looks like it was left over from the previous implementation of
DMIC PDM token parsing. It is not used anymore.
Reviewed-by: Bard Liao <yung-chuan.liao at linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
---
sound/soc/sof/topology.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 3b4e09089643..36dc87514dce 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -2944,14 +2944,6 @@ static int sof_link_dmic_load(struct snd_soc_component *scomp, int index,
return ret;
}
- /*
- * alloc memory for private member
- * Used to track the pdm config array index currently being parsed
- */
- sdev->private = kzalloc(sizeof(u32), GFP_KERNEL);
- if (!sdev->private)
- return -ENOMEM;
-
/* get DMIC PDM tokens */
ret = sof_parse_token_sets(scomp, &config->dmic.pdm[0], dmic_pdm_tokens,
ARRAY_SIZE(dmic_pdm_tokens), private->array,
@@ -2962,7 +2954,7 @@ static int sof_link_dmic_load(struct snd_soc_component *scomp, int index,
if (ret != 0) {
dev_err(scomp->dev, "error: parse dmic pdm tokens failed %d\n",
le32_to_cpu(private->size));
- goto err;
+ return ret;
}
/* set IPC header size */
@@ -3007,9 +2999,6 @@ static int sof_link_dmic_load(struct snd_soc_component *scomp, int index,
dev_err(scomp->dev, "error: failed to save DAI config for DMIC%d\n",
config->dai_index);
-err:
- kfree(sdev->private);
-
return ret;
}
--
2.25.1
More information about the Alsa-devel
mailing list