Skip to content
Commit 19ad683a authored by anish kumar's avatar anish kumar Committed by Mark Brown
Browse files

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: default avataranish kumar <yesanishhere@gmail.com>
Reviewed-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent f19c181f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment