From 3315cf95834fb5d612f6a5eb718c3620b80dd05e Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 18 Jul 2023 16:13:04 +0200 Subject: [PATCH] ALSA: emu10k1: Go back and simplify with snd_ctl_find_id() Now that snd_ctl_find_id() takes the locking itself, we can get rid of the messy locking in the caller side in snd_emu10k1_verify_controls(). Link: https://lore.kernel.org/r/20230718141304.1032-12-tiwai@suse.de Signed-off-by: Takashi Iwai --- sound/pci/emu10k1/emufx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c index 318a064f2cec..f114bda25eea 100644 --- a/sound/pci/emu10k1/emufx.c +++ b/sound/pci/emu10k1/emufx.c @@ -799,13 +799,10 @@ static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu, if (snd_emu10k1_look_for_ctl(emu, &gctl->id)) continue; gctl_id = (struct snd_ctl_elem_id *)&gctl->id; - down_read(&emu->card->controls_rwsem); - if (snd_ctl_find_id_locked(emu->card, gctl_id)) { - up_read(&emu->card->controls_rwsem); + if (snd_ctl_find_id(emu->card, gctl_id)) { err = -EEXIST; goto __error; } - up_read(&emu->card->controls_rwsem); if (gctl_id->iface != SNDRV_CTL_ELEM_IFACE_MIXER && gctl_id->iface != SNDRV_CTL_ELEM_IFACE_PCM) { err = -EINVAL; -- 2.11.0