aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/pci/es1968.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-07-20 10:21:02 +0200
committerTakashi Iwai <tiwai@suse.de>2023-07-21 09:10:41 +0200
commit5f2a937bd15614ad1836aacea06c6a1f49734859 (patch)
tree191341260bcfa987dbe7c73dc6c70afb7ed48fbb /sound/pci/es1968.c
parentALSA: emu10k1: Simplify with snd_ctl_find_id_mixer() (diff)
downloadwireguard-linux-5f2a937bd15614ad1836aacea06c6a1f49734859.tar.xz
wireguard-linux-5f2a937bd15614ad1836aacea06c6a1f49734859.zip
ALSA: es1968: 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-6-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/es1968.c')
-rw-r--r--sound/pci/es1968.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 4a7e20bb11bc..4bc0f53c223b 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -2005,9 +2005,6 @@ snd_es1968_mixer(struct es1968 *chip)
{
struct snd_ac97_bus *pbus;
struct snd_ac97_template ac97;
-#ifndef CONFIG_SND_ES1968_INPUT
- struct snd_ctl_elem_id elem_id;
-#endif
int err;
static const struct snd_ac97_bus_ops ops = {
.write = snd_es1968_ac97_write,
@@ -2027,14 +2024,10 @@ snd_es1968_mixer(struct es1968 *chip)
#ifndef CONFIG_SND_ES1968_INPUT
/* attach master switch / volumes for h/w volume control */
- memset(&elem_id, 0, sizeof(elem_id));
- elem_id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
- strcpy(elem_id.name, "Master Playback Switch");
- chip->master_switch = snd_ctl_find_id(chip->card, &elem_id);
- 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);
+ chip->master_switch = snd_ctl_find_id_mixer(chip->card,
+ "Master Playback Switch");
+ chip->master_volume = snd_ctl_find_id_mixer(chip->card,
+ "Master Playback Volume");
#endif
return 0;