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

ASoC: mediatek: mt8188: Simplify with snd_ctl_find_id_mixer()

Replace an open code with the new snd_ctl_find_id_mixer().
There is no functional change.

Acked-by: Mark Brown <broonie@kernel.org>
Cc: Trevor Wu <trevor.wu@mediatek.com>
Link: https://lore.kernel.org/r/20230720082108.31346-11-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+1 -11
+1 -11
sound/soc/mediatek/mt8188/mt8188-mt6359.c
··· 969 969 }, 970 970 }; 971 971 972 - static struct snd_kcontrol *ctl_find(struct snd_card *card, const char *name) 973 - { 974 - struct snd_ctl_elem_id sid; 975 - 976 - memset(&sid, 0, sizeof(sid)); 977 - strcpy(sid.name, name); 978 - sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 979 - return snd_ctl_find_id(card, &sid); 980 - } 981 - 982 972 static void mt8188_fixup_controls(struct snd_soc_card *card) 983 973 { 984 974 struct mt8188_mt6359_priv *priv = snd_soc_card_get_drvdata(card); ··· 985 995 snd_soc_dapm_free_widget(w); 986 996 } 987 997 988 - kctl = ctl_find(card->snd_card, "Headphone Switch"); 998 + kctl = snd_ctl_find_id_mixer(card->snd_card, "Headphone Switch"); 989 999 if (kctl) 990 1000 snd_ctl_remove(card->snd_card, kctl); 991 1001 else