Commit cecc34ae authored by Takashi Iwai's avatar Takashi Iwai

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.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent ee14bad1
...@@ -41,12 +41,9 @@ static int patch_build_controls(struct snd_ac97 * ac97, const struct snd_kcontro ...@@ -41,12 +41,9 @@ static int patch_build_controls(struct snd_ac97 * ac97, const struct snd_kcontro
static void reset_tlv(struct snd_ac97 *ac97, const char *name, static void reset_tlv(struct snd_ac97 *ac97, const char *name,
const unsigned int *tlv) const unsigned int *tlv)
{ {
struct snd_ctl_elem_id sid;
struct snd_kcontrol *kctl; struct snd_kcontrol *kctl;
memset(&sid, 0, sizeof(sid));
strcpy(sid.name, name); kctl = snd_ctl_find_id_mixer(ac97->bus->card, name);
sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
kctl = snd_ctl_find_id(ac97->bus->card, &sid);
if (kctl && kctl->tlv.p) if (kctl && kctl->tlv.p)
kctl->tlv.p = tlv; kctl->tlv.p = tlv;
} }
......
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