ASoC: simple-card-utils: don't select unnecessary Platform
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 19 Jun 2019 01:19:31 +0000 (10:19 +0900)
committerMark Brown <broonie@kernel.org>
Wed, 19 Jun 2019 11:58:34 +0000 (12:58 +0100)
ALSA SoC is now supporting "no Platform". Sound card doesn't need to
select "CPU component" as "Platform" anymore if it doesn't need
special Platform.
This patch removes such settings.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/generic/simple-card-utils.c

index ac8678fe55ffc3a5e2dbf0322850f7d817728e27..3cf5cb21ea5252640ed699d6d2c74f4114ef4d76 100644 (file)
@@ -346,9 +346,18 @@ EXPORT_SYMBOL_GPL(asoc_simple_dai_init);
 
 void asoc_simple_canonicalize_platform(struct snd_soc_dai_link *dai_link)
 {
-       /* Assumes platform == cpu */
-       if (!dai_link->platforms->of_node)
-               dai_link->platforms->of_node = dai_link->cpus->of_node;
+       /*
+        * no Platform
+        *
+        * It will be waste of memory, but not be memory leak.
+        * see
+        *      asoc_simple_init_priv()
+        *      asoc_simple_priv
+        */
+       if (!dai_link->platforms->of_node) {
+               dai_link->platforms     = NULL;
+               dai_link->num_platforms = 0;
+       }
 }
 EXPORT_SYMBOL_GPL(asoc_simple_canonicalize_platform);