ALSA: emu10k1: remove pointless locks from /proc code
emu_lock locks the card's registers, but that's necessary only for multi-register access, incl. read-modify-write cycles. Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Link: https://lore.kernel.org/r/20230428095941.1706278-3-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
16cafbd977
commit
71781147da
|
@ -399,13 +399,10 @@ static void snd_emu_proc_io_reg_read(struct snd_info_entry *entry,
|
|||
{
|
||||
struct snd_emu10k1 *emu = entry->private_data;
|
||||
unsigned long value;
|
||||
unsigned long flags;
|
||||
int i;
|
||||
snd_iprintf(buffer, "IO Registers:\n\n");
|
||||
for(i = 0; i < 0x40; i+=4) {
|
||||
spin_lock_irqsave(&emu->emu_lock, flags);
|
||||
value = inl(emu->port + i);
|
||||
spin_unlock_irqrestore(&emu->emu_lock, flags);
|
||||
snd_iprintf(buffer, "%02X: %08lX\n", i, value);
|
||||
}
|
||||
}
|
||||
|
@ -414,16 +411,13 @@ static void snd_emu_proc_io_reg_write(struct snd_info_entry *entry,
|
|||
struct snd_info_buffer *buffer)
|
||||
{
|
||||
struct snd_emu10k1 *emu = entry->private_data;
|
||||
unsigned long flags;
|
||||
char line[64];
|
||||
u32 reg, val;
|
||||
while (!snd_info_get_line(buffer, line, sizeof(line))) {
|
||||
if (sscanf(line, "%x %x", ®, &val) != 2)
|
||||
continue;
|
||||
if (reg < 0x40 && val <= 0xffffffff) {
|
||||
spin_lock_irqsave(&emu->emu_lock, flags);
|
||||
outl(val, emu->port + (reg & 0xfffffffc));
|
||||
spin_unlock_irqrestore(&emu->emu_lock, flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue