Skip to content

Commit 4791c42

Browse files
charleskeepaxbroonie
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c8a132e commit 4791c42

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

sound/soc/codecs/cs35l45.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,10 @@ static int cs35l45_activate_ctl(struct snd_soc_component *component,
176176
struct snd_kcontrol *kcontrol;
177177
struct snd_kcontrol_volatile *vd;
178178
unsigned int index_offset;
179-
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
180179

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);
188181
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);
190183
return -EINVAL;
191184
}
192185

0 commit comments

Comments
 (0)