usb: gadget: f_fs: Add compat_ioctl to epfiles
authorJerry Zhang <zhangjerry@google.com>
Fri, 30 Mar 2018 22:32:19 +0000 (15:32 -0700)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 15 May 2018 07:08:56 +0000 (10:08 +0300)
This allows 32 bit owners of ffs endpoints to
make ioctls into a 64 bit kernel.

All of the current epfile ioctls can be handled
with the same struct definitions as regular
ioctl.

Acked-by: MichaƂ Nazarewicz <mina86@mina86.com>
Signed-off-by: Jerry Zhang <zhangjerry@google.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/function/f_fs.c

index 0294e4f..199d257 100644 (file)
@@ -1266,6 +1266,14 @@ static long ffs_epfile_ioctl(struct file *file, unsigned code,
        return ret;
 }
 
+#ifdef CONFIG_COMPAT
+static long ffs_epfile_compat_ioctl(struct file *file, unsigned code,
+               unsigned long value)
+{
+       return ffs_epfile_ioctl(file, code, value);
+}
+#endif
+
 static const struct file_operations ffs_epfile_operations = {
        .llseek =       no_llseek,
 
@@ -1274,6 +1282,9 @@ static const struct file_operations ffs_epfile_operations = {
        .read_iter =    ffs_epfile_read_iter,
        .release =      ffs_epfile_release,
        .unlocked_ioctl =       ffs_epfile_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl = ffs_epfile_compat_ioctl,
+#endif
 };