Skip to contentSkip to conversation

usb: gadget: f_fs: Add compat_ioctl to epfiles

PATCH Jerry Zhang 1 participant 1 message Mar 30, 2018 USB

lore
Share & tools
lore
#0 lore raw

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.

---
 drivers/usb/gadget/function/f_fs.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/usb/gadget/function/f_fs.c +11 -0
index d2428a9e8900..34d80cc2b667 100644
@@ -1262,6 +1262,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,
 
@@ -1270,6 +1278,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
 };