From 67616feda99e32cb676b0907284bbb6957e45480 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 30 Aug 2017 15:39:32 +0200 Subject: ALSA: pcm: Unify ioctl functions for playback and capture streams Some ioctl functions are implemented individually for both playback and capture streams although most of the codes are identical with just a few different stream-specific function calls. This patch unifies these places, removes the superfluous trivial check and flattens the call paths as a cleanup. Meanwhile, for better readability, some codes (e.g. xfer ioctls or forward/rewind ioctls) are factored out as functions. Signed-off-by: Takashi Iwai --- sound/core/pcm_compat.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sound/core/pcm_compat.c') diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c index 10f537f..3a1cc7b 100644 --- a/sound/core/pcm_compat.c +++ b/sound/core/pcm_compat.c @@ -689,10 +689,7 @@ static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned l case SNDRV_PCM_IOCTL_XRUN: case SNDRV_PCM_IOCTL_LINK: case SNDRV_PCM_IOCTL_UNLINK: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) - return snd_pcm_playback_ioctl1(file, substream, cmd, argp); - else - return snd_pcm_capture_ioctl1(file, substream, cmd, argp); + return snd_pcm_common_ioctl(file, substream, cmd, argp); case SNDRV_PCM_IOCTL_HW_REFINE32: return snd_pcm_ioctl_hw_params_compat(substream, 1, argp); case SNDRV_PCM_IOCTL_HW_PARAMS32: -- cgit v1.1