ASoC: SOF: topology: remove unnecessary memory alloc for sdev->private
authorRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Mon, 24 Aug 2020 20:09:07 +0000 (15:09 -0500)
committerMark Brown <broonie@kernel.org>
Tue, 25 Aug 2020 19:39:35 +0000 (20:39 +0100)
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@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200824200912.46852-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/topology.c

index 3b4e0908964327a953f21ef58f4c404dcc4bbf54..36dc87514dce4df6806977c2a690a384f92c55cc 100644 (file)
@@ -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;
 }