diff options
author | Takashi Iwai <tiwai@suse.de> | 2023-07-20 10:20:59 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-07-21 09:10:39 +0200 |
commit | 7affe6fd2a3a75ad0f052bc7e9965b38807bb113 (patch) | |
tree | 4777b8e1603ed82335ad1562db97220a9a7ed194 /sound/pci/ca0106 | |
parent | ALSA: control: Introduce snd_ctl_find_id_mixer() (diff) | |
download | linux-7affe6fd2a3a75ad0f052bc7e9965b38807bb113.tar.xz linux-7affe6fd2a3a75ad0f052bc7e9965b38807bb113.zip |
ALSA: ca0106: Simplify with snd_ctl_find_id_mixer()
Replace an open code with the new snd_ctl_find_id_mixer().
There is no functional change.
Link: https://lore.kernel.org/r/20230720082108.31346-3-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ca0106')
-rw-r--r-- | sound/pci/ca0106/ca0106_mixer.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c index f6381c098d4f..2f37d2c3dd38 100644 --- a/sound/pci/ca0106/ca0106_mixer.c +++ b/sound/pci/ca0106/ca0106_mixer.c @@ -706,19 +706,9 @@ static int remove_ctl(struct snd_card *card, const char *name) return snd_ctl_remove_id(card, &id); } -static struct snd_kcontrol *ctl_find(struct snd_card *card, const char *name) -{ - struct snd_ctl_elem_id sid; - memset(&sid, 0, sizeof(sid)); - /* FIXME: strcpy is bad. */ - strcpy(sid.name, name); - sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER; - return snd_ctl_find_id(card, &sid); -} - static int rename_ctl(struct snd_card *card, const char *src, const char *dst) { - struct snd_kcontrol *kctl = ctl_find(card, src); + struct snd_kcontrol *kctl = snd_ctl_find_id_mixer(card, src); if (kctl) { snd_ctl_rename(card, kctl, dst); return 0; @@ -765,7 +755,8 @@ static void add_followers(struct snd_card *card, struct snd_kcontrol *master, const char * const *list) { for (; *list; list++) { - struct snd_kcontrol *follower = ctl_find(card, *list); + struct snd_kcontrol *follower = + snd_ctl_find_id_mixer(card, *list); if (follower) snd_ctl_add_follower(master, follower); } |