Commit 50164f69 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen Committed by Takashi Iwai
Browse files

ALSA: emu10k1: use the right lock in snd_emu10k1_shared_spdif_put()



The function does read-modify-write cycles on the card's registers, and
doesn't access mutable members of the emu data structure.

I suppose this might have been a mixup due to the lock names being
logically swapped.

Signed-off-by: default avatarOswald Buddenhagen <oswald.buddenhagen@gmx.de>
Link: https://lore.kernel.org/r/20230428095941.1706278-4-oswald.buddenhagen@gmx.de


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 71781147
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1654,7 +1654,7 @@ static int snd_emu10k1_shared_spdif_put(struct snd_kcontrol *kcontrol,
	sw = ucontrol->value.integer.value[0];
	sw = ucontrol->value.integer.value[0];
	if (emu->card_capabilities->invert_shared_spdif)
	if (emu->card_capabilities->invert_shared_spdif)
		sw = !sw;
		sw = !sw;
	spin_lock_irqsave(&emu->reg_lock, flags);
	spin_lock_irqsave(&emu->emu_lock, flags);
	if ( emu->card_capabilities->i2c_adc) {
	if ( emu->card_capabilities->i2c_adc) {
		/* Do nothing for Audigy 2 ZS Notebook */
		/* Do nothing for Audigy 2 ZS Notebook */
	} else if (emu->audigy) {
	} else if (emu->audigy) {
@@ -1675,7 +1675,7 @@ static int snd_emu10k1_shared_spdif_put(struct snd_kcontrol *kcontrol,
		reg |= val;
		reg |= val;
		outl(reg | val, emu->port + HCFG);
		outl(reg | val, emu->port + HCFG);
	}
	}
	spin_unlock_irqrestore(&emu->reg_lock, flags);
	spin_unlock_irqrestore(&emu->emu_lock, flags);
	return change;
	return change;
}
}