Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+1 -3
+1 -3
sound/pci/sis7019.c
··· 902 902 /* Get the AC97 semaphore -- software first, so we don't spin 903 903 * pounding out IO reads on the hardware semaphore... 904 904 */ 905 - mutex_lock(&sis->ac97_mutex); 905 + guard(mutex)(&sis->ac97_mutex); 906 906 907 907 count = 0xffff; 908 908 while ((inw(io + SIS_AC97_SEMA) & SIS_AC97_SEMA_BUSY) && --count) ··· 941 941 timeout_sema: 942 942 outl(SIS_AC97_SEMA_RELEASE, io + SIS_AC97_SEMA); 943 943 timeout: 944 - mutex_unlock(&sis->ac97_mutex); 945 - 946 944 if (!count) { 947 945 dev_err(&sis->pci->dev, "ac97 codec %d timeout cmd 0x%08x\n", 948 946 codec, cmd);