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

ALSA: hda/analog: Use guard() for mutex locks

Replace the manual mutex lock/unlock pairs with guard().

Only code refactoring, and no behavior change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250827072916.31933-18-tiwai@suse.de

+1 -2
+1 -2
sound/hda/codecs/analog.c
··· 727 727 if (spec->cur_smux == val) 728 728 return 0; 729 729 730 - mutex_lock(&codec->control_mutex); 730 + guard(mutex)(&codec->control_mutex); 731 731 path = snd_hda_get_path_from_idx(codec, 732 732 spec->smux_paths[spec->cur_smux]); 733 733 if (path) ··· 736 736 if (path) 737 737 snd_hda_activate_path(codec, path, true, true); 738 738 spec->cur_smux = val; 739 - mutex_unlock(&codec->control_mutex); 740 739 return 1; 741 740 } 742 741