mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user