Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: cs35l45: Use new snd_soc_component_get_kcontrol_locked() helper

No longer any need to hard code the addition of the name prefix, use the
new helper function.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20240802105734.2309788-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Charles Keepax and committed by
Mark Brown
4791c422 c8a132e2

+2 -9
+2 -9
sound/soc/codecs/cs35l45.c
··· 176 176 struct snd_kcontrol *kcontrol; 177 177 struct snd_kcontrol_volatile *vd; 178 178 unsigned int index_offset; 179 - char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 180 179 181 - if (component->name_prefix) 182 - snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "%s %s", 183 - component->name_prefix, ctl_name); 184 - else 185 - snprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "%s", ctl_name); 186 - 187 - kcontrol = snd_soc_card_get_kcontrol_locked(component->card, name); 180 + kcontrol = snd_soc_component_get_kcontrol_locked(component, ctl_name); 188 181 if (!kcontrol) { 189 - dev_err(component->dev, "Can't find kcontrol %s\n", name); 182 + dev_err(component->dev, "Can't find kcontrol %s\n", ctl_name); 190 183 return -EINVAL; 191 184 } 192 185