diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-09-10 13:09:25 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-09-10 13:20:01 +0200 |
| commit | d5323227325696b6458eae3cf84705f5caa595fb (patch) | |
| tree | fe657980c6e89cb7c4b824e905b19754d73ecec7 | |
| parent | bdcdb4e7aa410122baa3496b93e7850dc20a90fa (diff) | |
ALSA: usb: fcp: 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>
| -rw-r--r-- | sound/usb/fcp.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sound/usb/fcp.c b/sound/usb/fcp.c index 98f9964311a7..5ee8d8b66058 100644 --- a/sound/usb/fcp.c +++ b/sound/usb/fcp.c @@ -820,7 +820,6 @@ static long fcp_hwdep_read(struct snd_hwdep *hw, char __user *buf, { struct usb_mixer_interface *mixer = hw->private_data; struct fcp_data *private = mixer->private_data; - unsigned long flags; long ret = 0; u32 event; @@ -832,10 +831,10 @@ static long fcp_hwdep_read(struct snd_hwdep *hw, char __user *buf, if (ret) return ret; - spin_lock_irqsave(&private->notify.lock, flags); - event = private->notify.event; - private->notify.event = 0; - spin_unlock_irqrestore(&private->notify.lock, flags); + scoped_guard(spinlock_irqsave, &private->notify.lock) { + event = private->notify.event; + private->notify.event = 0; + } if (copy_to_user(buf, &event, sizeof(event))) return -EFAULT; @@ -946,11 +945,9 @@ static void fcp_notify(struct urb *urb) } if (data) { - unsigned long flags; - - spin_lock_irqsave(&private->notify.lock, flags); - private->notify.event |= data; - spin_unlock_irqrestore(&private->notify.lock, flags); + scoped_guard(spinlock_irqsave, &private->notify.lock) { + private->notify.event |= data; + } wake_up_interruptible(&private->notify.queue); } |
