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> Signed-off-by: Meng Wang <mwang@codeaurora.org>
This commit is contained in:
parent
a3bbd35522
commit
beb98e57f2
1 changed files with 16 additions and 0 deletions
|
@ -667,6 +667,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)
|
||||
{
|
||||
|
@ -748,6 +762,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;
|
||||
|
|
Loading…
Add table
Reference in a new issue