ASoC: dapm: Avoid creating kcontrol for params
authoranish kumar <yesanishhere@gmail.com>
Fri, 29 Sep 2017 04:52:39 +0000 (21:52 -0700)
committerMark Brown <broonie@kernel.org>
Thu, 5 Oct 2017 19:43:05 +0000 (20:43 +0100)
commit19ad683abc8534cd755403381c73c0ddce7b9f6d
tree9da13062c93bf962ed7293a7dd1b91416b3c8309
parentf19c181f20cdfb2aa5f4a1bba095a008e34ed61b
ASoC: dapm: Avoid creating kcontrol for params

Currently in codec to codec dai link if there are multiple
params defined then dapm can use created kcontrol to
decide which param to apply at runtime.

However, in case there is only single param configuration
then there is no point in creating the kcontrol and also there
is no point in allocating memory for kcontrol.

In the snd_soc_dapm_new_pcm function, there is memory
allocation happening for kcontrol which is later used
or not used based on num_param. It is better to not
allocate memory when there is only a single configuration.
This change is to remedy that anomaly.

Signed-off-by: anish kumar <yesanishhere@gmail.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-dapm.c