diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-08-29 16:52:42 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-09-01 13:53:01 +0200 |
| commit | ca1d5ca2e5022f989e3ef48eb2d678a551fb814f (patch) | |
| tree | ccf70b2e1e6e60bcc43d76ed5c2f6ab0979b4084 /sound/isa | |
| parent | 8c6a0bc917b4ba7db9945dacda7cc582af7a335f (diff) | |
ALSA: cmi8330: Use guard() for spin locks
Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829145300.5460-3-tiwai@suse.de
Diffstat (limited to 'sound/isa')
| -rw-r--r-- | sound/isa/cmi8330.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index e681c2c82474..3d1f19321b9e 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c @@ -269,18 +269,17 @@ static const unsigned char cmi8330_sb_init_values[][2] = { static int cmi8330_add_sb_mixers(struct snd_sb *chip) { int idx, err; - unsigned long flags; - spin_lock_irqsave(&chip->mixer_lock, flags); - snd_sbmixer_write(chip, 0x00, 0x00); /* mixer reset */ - spin_unlock_irqrestore(&chip->mixer_lock, flags); + scoped_guard(spinlock_irqsave, &chip->mixer_lock) { + snd_sbmixer_write(chip, 0x00, 0x00); /* mixer reset */ + } /* mute and zero volume channels */ for (idx = 0; idx < ARRAY_SIZE(cmi8330_sb_init_values); idx++) { - spin_lock_irqsave(&chip->mixer_lock, flags); - snd_sbmixer_write(chip, cmi8330_sb_init_values[idx][0], - cmi8330_sb_init_values[idx][1]); - spin_unlock_irqrestore(&chip->mixer_lock, flags); + scoped_guard(spinlock_irqsave, &chip->mixer_lock) { + snd_sbmixer_write(chip, cmi8330_sb_init_values[idx][0], + cmi8330_sb_init_values[idx][1]); + } } for (idx = 0; idx < ARRAY_SIZE(cmi8330_sb_mixers); idx++) { |