Skip to content

Commit cecc34a

Browse files
committed
ALSA: ac97: More cleanup with snd_ctl_find_id_mixer()
There was one overlooked place to be replaced with snd_ctl_find_id_mixer() for code simplification. No functional change, only code refactoring. Link: https://lore.kernel.org/r/20240304082158.8583-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent ee14bad commit cecc34a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

sound/pci/ac97/ac97_patch.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,9 @@ static int patch_build_controls(struct snd_ac97 * ac97, const struct snd_kcontro
4141
static void reset_tlv(struct snd_ac97 *ac97, const char *name,
4242
const unsigned int *tlv)
4343
{
44-
struct snd_ctl_elem_id sid;
4544
struct snd_kcontrol *kctl;
46-
memset(&sid, 0, sizeof(sid));
47-
strcpy(sid.name, name);
48-
sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
49-
kctl = snd_ctl_find_id(ac97->bus->card, &sid);
45+
46+
kctl = snd_ctl_find_id_mixer(ac97->bus->card, name);
5047
if (kctl && kctl->tlv.p)
5148
kctl->tlv.p = tlv;
5249
}

0 commit comments

Comments
 (0)