lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri,  5 May 2023 17:55:14 +0100
From:   Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To:     broonie@...nel.org, tiwai@...e.com
Cc:     perex@...ex.cz, lgirdwood@...il.com, ckeepax@...nsource.cirrus.com,
        kuninori.morimoto.gx@...esas.com, linux-kernel@...r.kernel.org,
        pierre-louis.bossart@...ux.intel.com, alsa-devel@...a-project.org,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Subject: [PATCH 3/3] ASoC: hdmi-codec: use snd_soc_cnew to add controls

If there are multiple instances of this codec in a sound card using snd_ctl_new1
will fail with below error because of duplicate control names.

snd-sc8280xp sound: control 3:16:0:IEC958 Playback Mask:0 is already present
hdmi-audio-codec hdmi-audio-codec.4.auto: ASoC: error at snd_soc_pcm_dai_new on i2s-hifi: -16

Fix this by using snd_soc_cnew along with component name prefix to avoid
this duplication.

This issue is noticed on x13s laptop which has multiple instances of Displayport.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
---
 sound/soc/codecs/hdmi-codec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c
index 8c54cddf86b6..48d1eef9c806 100644
--- a/sound/soc/codecs/hdmi-codec.c
+++ b/sound/soc/codecs/hdmi-codec.c
@@ -801,7 +801,8 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
 		struct snd_kcontrol *kctl;
 
 		/* add ELD ctl with the device number corresponding to the PCM stream */
-		kctl = snd_ctl_new1(&hdmi_codec_controls[i], dai->component);
+		kctl = snd_soc_cnew(&hdmi_codec_controls[i], dai->component, NULL,
+				    dai->component->name_prefix);
 		if (!kctl)
 			return -ENOMEM;
 
-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ