summaryrefslogtreecommitdiff
path: root/sound/hda/controllers/intel.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2025-08-27 09:28:58 +0200
committerTakashi Iwai <tiwai@suse.de>2025-08-29 11:52:15 +0200
commit59195f13ee61566091989d9d048b2768671c7b27 (patch)
tree84f89b78a360b3bdb9e9102677e41e0b82435a82 /sound/hda/controllers/intel.c
parentd2a8792b9747e5a08194957db24491c237740565 (diff)
ALSA: hda/intel: 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-19-tiwai@suse.de
Diffstat (limited to 'sound/hda/controllers/intel.c')
-rw-r--r--sound/hda/controllers/intel.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/hda/controllers/intel.c b/sound/hda/controllers/intel.c
index 1bb3ff55b115..1e13678428d2 100644
--- a/sound/hda/controllers/intel.c
+++ b/sound/hda/controllers/intel.c
@@ -915,17 +915,17 @@ static void azx_shutdown_chip(struct azx *chip)
static void azx_add_card_list(struct azx *chip)
{
struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
- mutex_lock(&card_list_lock);
+
+ guard(mutex)(&card_list_lock);
list_add(&hda->list, &card_list);
- mutex_unlock(&card_list_lock);
}
static void azx_del_card_list(struct azx *chip)
{
struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
- mutex_lock(&card_list_lock);
+
+ guard(mutex)(&card_list_lock);
list_del_init(&hda->list);
- mutex_unlock(&card_list_lock);
}
/* trigger power-save check at writing parameter */
@@ -942,7 +942,7 @@ static int __maybe_unused param_set_xint(const char *val, const struct kernel_pa
if (pm_blacklist > 0)
return 0;
- mutex_lock(&card_list_lock);
+ guard(mutex)(&card_list_lock);
list_for_each_entry(hda, &card_list, list) {
chip = &hda->chip;
if (!hda->probe_continued || chip->disabled ||
@@ -950,7 +950,6 @@ static int __maybe_unused param_set_xint(const char *val, const struct kernel_pa
continue;
snd_hda_set_power_save(&chip->bus, power_save * 1000);
}
- mutex_unlock(&card_list_lock);
return 0;
}