ALSA: via82xx: Simplify with snd_ctl_find_id_mixer()
authorTakashi Iwai <tiwai@suse.de>
Thu, 20 Jul 2023 08:21:05 +0000 (10:21 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 21 Jul 2023 07:10:43 +0000 (09:10 +0200)
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-9-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/via82xx.c

index 361b83fd721e61650e0697164e7061fe8b88b7cf..d8666ff7bdfae02e8278f7e698fb7927d479c3b7 100644 (file)
@@ -1984,11 +1984,7 @@ static int snd_via8233_init_misc(struct via82xx *chip)
                /* when no h/w PCM volume control is found, use DXS volume control
                 * as the PCM vol control
                 */
-               struct snd_ctl_elem_id sid;
-               memset(&sid, 0, sizeof(sid));
-               strcpy(sid.name, "PCM Playback Volume");
-               sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
-               if (! snd_ctl_find_id(chip->card, &sid)) {
+               if (!snd_ctl_find_id_mixer(chip->card, "PCM Playback Volume")) {
                        dev_info(chip->card->dev,
                                 "Using DXS as PCM Playback\n");
                        err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_via8233_pcmdxs_volume_control, chip));