Commit b6ba0aa4 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: cmipci: 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-10-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent a16ea09d
...@@ -2734,12 +2734,8 @@ static int snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_device) ...@@ -2734,12 +2734,8 @@ static int snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_device)
} }
for (idx = 0; idx < CM_SAVED_MIXERS; idx++) { for (idx = 0; idx < CM_SAVED_MIXERS; idx++) {
struct snd_ctl_elem_id elem_id;
struct snd_kcontrol *ctl; struct snd_kcontrol *ctl;
memset(&elem_id, 0, sizeof(elem_id)); ctl = snd_ctl_find_id_mixer(cm->card, cm_saved_mixer[idx].name);
elem_id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
strcpy(elem_id.name, cm_saved_mixer[idx].name);
ctl = snd_ctl_find_id(cm->card, &elem_id);
if (ctl) if (ctl)
cm->mixer_res_ctl[idx] = ctl; cm->mixer_res_ctl[idx] = ctl;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment