From: Jerry Zhang Date: Fri, 30 Mar 2018 22:32:19 +0000 (-0700) Subject: usb: gadget: f_fs: Add compat_ioctl to epfiles X-Git-Tag: pci-v4.18-changes-2~32^2~81^2~93 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6819e3233f244be6e8ea4aba139434ada0698743;p=users%2Fdwmw2%2Flinux.git usb: gadget: f_fs: Add compat_ioctl to epfiles 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 Signed-off-by: Jerry Zhang Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 0294e4f188739..199d257000505 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -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 };