ALSA: pcm: Clean up SNDRV_PCM_IOCTL_PAUSE code
authorTakashi Iwai <tiwai@suse.de>
Tue, 24 May 2016 12:58:04 +0000 (14:58 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 14 Jun 2017 05:43:09 +0000 (07:43 +0200)
Use snd_pcm_action_lock_irq() helper instead of open coding.
No functional change.

Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_native.c

index 07995e6453279808da6b03a0c7a7a0fddf095c5a..798bca967c0e5ee5fcbe710d4e71574dd0953a25 100644 (file)
@@ -2865,13 +2865,9 @@ static int snd_pcm_common_ioctl1(struct file *file,
        case SNDRV_PCM_IOCTL_DROP:
                return snd_pcm_drop(substream);
        case SNDRV_PCM_IOCTL_PAUSE:
-       {
-               int res;
-               snd_pcm_stream_lock_irq(substream);
-               res = snd_pcm_pause(substream, (int)(unsigned long)arg);
-               snd_pcm_stream_unlock_irq(substream);
-               return res;
-       }
+               return snd_pcm_action_lock_irq(&snd_pcm_action_pause,
+                                              substream,
+                                              (int)(unsigned long)arg);
        }
        pcm_dbg(substream->pcm, "unknown ioctl = 0x%x\n", cmd);
        return -ENOTTY;