diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-08-29 16:43:29 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-09-01 13:52:42 +0200 |
| commit | e7b99fdddfe873b49f72b27676eeab6ec77f2633 (patch) | |
| tree | 8159fbba1ee70e42ea77c9bbbd86b47edb376c4e | |
| parent | bd6aa020ec491b3389b2141a5e8ba81248a777a6 (diff) | |
ALSA: sis7019: Use guard() for mutex locks
Replace the manual mutex lock/unlock pairs with guard() for code
simplification.
Only code refactoring, and no behavior change.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829144342.4290-55-tiwai@suse.de
| -rw-r--r-- | sound/pci/sis7019.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/pci/sis7019.c b/sound/pci/sis7019.c index 3d7abcb31679..a1341af8c41f 100644 --- a/sound/pci/sis7019.c +++ b/sound/pci/sis7019.c @@ -902,7 +902,7 @@ static unsigned short sis_ac97_rw(struct sis7019 *sis, int codec, u32 cmd) /* Get the AC97 semaphore -- software first, so we don't spin * pounding out IO reads on the hardware semaphore... */ - mutex_lock(&sis->ac97_mutex); + guard(mutex)(&sis->ac97_mutex); count = 0xffff; while ((inw(io + SIS_AC97_SEMA) & SIS_AC97_SEMA_BUSY) && --count) @@ -941,8 +941,6 @@ static unsigned short sis_ac97_rw(struct sis7019 *sis, int codec, u32 cmd) timeout_sema: outl(SIS_AC97_SEMA_RELEASE, io + SIS_AC97_SEMA); timeout: - mutex_unlock(&sis->ac97_mutex); - if (!count) { dev_err(&sis->pci->dev, "ac97 codec %d timeout cmd 0x%08x\n", codec, cmd); |
