Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9df94f73 authored by Banajit Goswami's avatar Banajit Goswami
Browse files

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: default avatarGopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: default avatarBanajit Goswami <bgoswami@codeaurora.org>
parent 04e0fcd6
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -673,6 +673,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)
{
@@ -756,6 +770,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;