summaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2023-07-12 16:57:48 +0200
committerTakashi Iwai <tiwai@suse.de>2023-07-13 07:57:30 +0200
commitdeb1200f6eb634a6e4d08ada953b72be1e8adcfa (patch)
tree4713a9fd867fcb3ce5c94311b2f91f73fdf28ce0 /sound/pci/emu10k1
parentALSA: emu10k1: make E-MU dock monitoring interrupt-driven (diff)
downloadlinux-deb1200f6eb634a6e4d08ada953b72be1e8adcfa.tar.xz
linux-deb1200f6eb634a6e4d08ada953b72be1e8adcfa.zip
ALSA: emu10k1: fix return value of snd_emu1010_adc_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/20230712145750.125086-1-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/emu10k1')
-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 f9500cd50a4b..573e1c7c5e50 100644
--- a/sound/pci/emu10k1/emumixer.c
+++ b/sound/pci/emu10k1/emumixer.c
@@ -770,18 +770,21 @@ static int snd_emu1010_adc_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
unsigned int mask = snd_emu1010_adc_pad_regs[kcontrol->private_value];
unsigned int val, cache;
+ int change;
+
val = ucontrol->value.integer.value[0];
cache = emu->emu1010.adc_pads;
if (val == 1)
cache = cache | mask;
else
cache = cache & ~mask;
- if (cache != emu->emu1010.adc_pads) {
+ change = (cache != emu->emu1010.adc_pads);
+ if (change) {
snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, cache );
emu->emu1010.adc_pads = cache;
}
- return 0;
+ return change;
}
static const struct snd_kcontrol_new emu1010_adc_pads_ctl = {