summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBanajit Goswami <bgoswami@codeaurora.org>2014-08-21 18:49:04 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:10:16 -0700
commit4ce9b377bb52706e1c09f65510ffc2bac783231a (patch)
tree2fef81cb37a8e16eee6a21da23ebd555a08669f6
parent9772b42f4818b434e105f76ac31512e4c9c6cafe (diff)
ASoC: core: Add compat ioctl support for listen driver
Change adds compat ioctl to listen driver for supporting 32 bit userspace client when kernel is compiled for 64 bit. Change-Id: Ie6a6fb1f2b6ea569e03b02bc520ef79b95c1009c Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org> Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
-rw-r--r--sound/core/pcm_compat.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c
index 7cfca1491f20..d3843924b1d1 100644
--- a/sound/core/pcm_compat.c
+++ b/sound/core/pcm_compat.c
@@ -502,6 +502,20 @@ static int snd_compressed_ioctl32(struct snd_pcm_substream *substream,
pr_debug("%s called with cmd = %d\n", __func__, cmd);
return err;
}
+static int snd_user_ioctl32(struct snd_pcm_substream *substream,
+ unsigned int cmd, void __user *arg)
+{
+ struct snd_pcm_runtime *runtime;
+ int err = -ENOIOCTLCMD;
+
+ if (PCM_RUNTIME_CHECK(substream))
+ return -ENXIO;
+ runtime = substream->runtime;
+ if (substream->ops->compat_ioctl)
+ err = substream->ops->compat_ioctl(substream, cmd, arg);
+ return err;
+}
+
static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg)
{
@@ -575,6 +589,8 @@ static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned l
default:
if (_IOC_TYPE(cmd) == 'C')
return snd_compressed_ioctl32(substream, cmd, argp);
+ else if (_IOC_TYPE(cmd) == 'U')
+ return snd_user_ioctl32(substream, cmd, argp);
}
return -ENOIOCTLCMD;