]> www.infradead.org Git - users/hch/misc.git/commitdiff
ALSA: hda/analog: Use guard() for mutex locks
authorTakashi Iwai <tiwai@suse.de>
Wed, 27 Aug 2025 07:28:57 +0000 (09:28 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 29 Aug 2025 09:52:15 +0000 (11:52 +0200)
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
sound/hda/codecs/analog.c

index 33aaeb44c4dce1e9d5b06bef37d5f8c30fd24e13..357ad5a6c0db52f5537d5dc22eeec2df7120ef32 100644 (file)
@@ -727,7 +727,7 @@ static int ad1988_auto_smux_enum_put(struct snd_kcontrol *kcontrol,
        if (spec->cur_smux == val)
                return 0;
 
-       mutex_lock(&codec->control_mutex);
+       guard(mutex)(&codec->control_mutex);
        path = snd_hda_get_path_from_idx(codec,
                                         spec->smux_paths[spec->cur_smux]);
        if (path)
@@ -736,7 +736,6 @@ static int ad1988_auto_smux_enum_put(struct snd_kcontrol *kcontrol,
        if (path)
                snd_hda_activate_path(codec, path, true, true);
        spec->cur_smux = val;
-       mutex_unlock(&codec->control_mutex);
        return 1;
 }