diff options
Diffstat (limited to 'sound/pci/ice1712/quartet.c')
-rw-r--r-- | sound/pci/ice1712/quartet.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/sound/pci/ice1712/quartet.c b/sound/pci/ice1712/quartet.c index 20b3e8f94719..f61ee9f5c754 100644 --- a/sound/pci/ice1712/quartet.c +++ b/sound/pci/ice1712/quartet.c @@ -766,26 +766,6 @@ static const char * const follower_vols[] = { static DECLARE_TLV_DB_SCALE(qtet_master_db_scale, -6350, 50, 1); -static struct snd_kcontrol *ctl_find(struct snd_card *card, - const char *name) -{ - struct snd_ctl_elem_id sid = {0}; - - strscpy(sid.name, name, sizeof(sid.name)); - sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER; - return snd_ctl_find_id(card, &sid); -} - -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); - if (follower) - snd_ctl_add_follower(master, follower); - } -} - static int qtet_add_controls(struct snd_ice1712 *ice) { struct qtet_spec *spec = ice->spec; @@ -806,10 +786,12 @@ static int qtet_add_controls(struct snd_ice1712 *ice) qtet_master_db_scale); if (!vmaster) return -ENOMEM; - add_followers(ice->card, vmaster, follower_vols); err = snd_ctl_add(ice->card, vmaster); if (err < 0) return err; + err = snd_ctl_add_followers(ice->card, vmaster, follower_vols); + if (err < 0) + return err; /* only capture SPDIF over AK4113 */ return snd_ak4113_build(spec->ak4113, ice->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream); |