summaryrefslogtreecommitdiff
path: root/sound/pci
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2023-05-16 12:36:07 +0300
committerTakashi Iwai <tiwai@suse.de>2023-05-17 18:07:55 +0300
commitcc766807a208bfa06c204be784ec099fb25c87a4 (patch)
tree001e7d91e4327ffd15279e951a582ac4992163b8 /sound/pci
parent511cbe8f59e30cd09a04c1dbafe6337d9111e88a (diff)
downloadlinux-cc766807a208bfa06c204be784ec099fb25c87a4.tar.xz
ALSA: emu10k1: fix return value of snd_emu1010_dac_pads_put()
It returned zero even if the value had changed. Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Link: https://lore.kernel.org/r/20230516093612.3536508-6-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/emu10k1/emumixer.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
index c5ebec52c8cf..ef05d4f3316c 100644
--- a/sound/pci/emu10k1/emumixer.c
+++ b/sound/pci/emu10k1/emumixer.c
@@ -559,18 +559,21 @@ static int snd_emu1010_dac_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
unsigned int mask = snd_emu1010_dac_regs[kcontrol->private_value];
unsigned int val, cache;
+ int change;
+
val = ucontrol->value.integer.value[0];
cache = emu->emu1010.dac_pads;
if (val == 1)
cache = cache | mask;
else
cache = cache & ~mask;
- if (cache != emu->emu1010.dac_pads) {
+ change = (cache != emu->emu1010.dac_pads);
+ if (change) {
snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, cache );
emu->emu1010.dac_pads = cache;
}
- return 0;
+ return change;
}
static const struct snd_kcontrol_new emu1010_dac_pads_ctl = {