diff options
author | Takashi Iwai <tiwai@suse.de> | 2023-07-20 10:21:03 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2023-07-21 09:10:41 +0200 |
commit | 171c983027c7790d44902531e7e90ab01bee3b17 (patch) | |
tree | 8f74c912280a51df075ad5e9f453def2eea0efa8 /sound/pci/ice1712/quartet.c | |
parent | 5f2a937bd15614ad1836aacea06c6a1f49734859 (diff) | |
download | linux-171c983027c7790d44902531e7e90ab01bee3b17.tar.gz linux-171c983027c7790d44902531e7e90ab01bee3b17.tar.bz2 linux-171c983027c7790d44902531e7e90ab01bee3b17.zip |
ALSA: ice1712: Simplify with snd_ctl_find_id_mixer()
Replace an open code with the new snd_ctl_find_id_mixer().
There is no functional change.
Also, add the missing NULL checks in psc724_set_jack_state() to deal
with error cases.
Link: https://lore.kernel.org/r/20230720082108.31346-7-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ice1712/quartet.c')
-rw-r--r-- | sound/pci/ice1712/quartet.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sound/pci/ice1712/quartet.c b/sound/pci/ice1712/quartet.c index 20b3e8f94719..9450c4b104f7 100644 --- a/sound/pci/ice1712/quartet.c +++ b/sound/pci/ice1712/quartet.c @@ -766,21 +766,12 @@ 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); + struct snd_kcontrol *follower = + snd_ctl_find_id_mixer(card, *list); if (follower) snd_ctl_add_follower(master, follower); } |