mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-11 17:10:13 +00:00
ALSA: i2c: 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/20250829151335.7342-2-tiwai@suse.de
This commit is contained in:
parent
95692e3c9f
commit
7a3dc0da93
@ -127,9 +127,9 @@ void snd_ak4113_reinit(struct ak4113 *chip)
|
||||
{
|
||||
if (atomic_inc_return(&chip->wq_processing) == 1)
|
||||
cancel_delayed_work_sync(&chip->work);
|
||||
mutex_lock(&chip->reinit_mutex);
|
||||
ak4113_init_regs(chip);
|
||||
mutex_unlock(&chip->reinit_mutex);
|
||||
scoped_guard(mutex, &chip->reinit_mutex) {
|
||||
ak4113_init_regs(chip);
|
||||
}
|
||||
/* bring up statistics / event queing */
|
||||
if (atomic_dec_and_test(&chip->wq_processing))
|
||||
schedule_delayed_work(&chip->work, HZ / 10);
|
||||
|
||||
@ -132,9 +132,9 @@ void snd_ak4114_reinit(struct ak4114 *chip)
|
||||
{
|
||||
if (atomic_inc_return(&chip->wq_processing) == 1)
|
||||
cancel_delayed_work_sync(&chip->work);
|
||||
mutex_lock(&chip->reinit_mutex);
|
||||
ak4114_init_regs(chip);
|
||||
mutex_unlock(&chip->reinit_mutex);
|
||||
scoped_guard(mutex, &chip->reinit_mutex) {
|
||||
ak4114_init_regs(chip);
|
||||
}
|
||||
/* bring up statistics / event queing */
|
||||
if (atomic_dec_and_test(&chip->wq_processing))
|
||||
schedule_delayed_work(&chip->work, HZ / 10);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user