Commit 233913c0 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: maestro3: 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-8-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 171c9830
...@@ -2029,9 +2029,6 @@ static int snd_m3_mixer(struct snd_m3 *chip) ...@@ -2029,9 +2029,6 @@ static int snd_m3_mixer(struct snd_m3 *chip)
{ {
struct snd_ac97_bus *pbus; struct snd_ac97_bus *pbus;
struct snd_ac97_template ac97; struct snd_ac97_template ac97;
#ifndef CONFIG_SND_MAESTRO3_INPUT
struct snd_ctl_elem_id elem_id;
#endif
int err; int err;
static const struct snd_ac97_bus_ops ops = { static const struct snd_ac97_bus_ops ops = {
.write = snd_m3_ac97_write, .write = snd_m3_ac97_write,
...@@ -2054,14 +2051,10 @@ static int snd_m3_mixer(struct snd_m3 *chip) ...@@ -2054,14 +2051,10 @@ static int snd_m3_mixer(struct snd_m3 *chip)
snd_ac97_write(chip->ac97, AC97_PCM, 0); snd_ac97_write(chip->ac97, AC97_PCM, 0);
#ifndef CONFIG_SND_MAESTRO3_INPUT #ifndef CONFIG_SND_MAESTRO3_INPUT
memset(&elem_id, 0, sizeof(elem_id)); chip->master_switch = snd_ctl_find_id_mixer(chip->card,
elem_id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; "Master Playback Switch");
strcpy(elem_id.name, "Master Playback Switch"); chip->master_volume = snd_ctl_find_id_mixer(chip->card,
chip->master_switch = snd_ctl_find_id(chip->card, &elem_id); "Master Playback Volume");
memset(&elem_id, 0, sizeof(elem_id));
elem_id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
strcpy(elem_id.name, "Master Playback Volume");
chip->master_volume = snd_ctl_find_id(chip->card, &elem_id);
#endif #endif
return 0; return 0;
......
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