aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/usbhid/hiddev.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
index e793127f971e..9837adcb17e9 100644
--- a/drivers/hid/usbhid/hiddev.c
+++ b/drivers/hid/usbhid/hiddev.c
@@ -34,6 +34,7 @@
34#include <linux/usb.h> 34#include <linux/usb.h>
35#include <linux/hid.h> 35#include <linux/hid.h>
36#include <linux/hiddev.h> 36#include <linux/hiddev.h>
37#include <linux/compat.h>
37#include "usbhid.h" 38#include "usbhid.h"
38 39
39#ifdef CONFIG_USB_DYNAMIC_MINORS 40#ifdef CONFIG_USB_DYNAMIC_MINORS
@@ -738,6 +739,14 @@ inval:
738 return -EINVAL; 739 return -EINVAL;
739} 740}
740 741
742#ifdef CONFIG_COMPAT
743static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
744{
745 struct inode *inode = file->f_path.dentry->d_inode;
746 return hiddev_ioctl(inode, file, cmd, compat_ptr(arg));
747}
748#endif
749
741static const struct file_operations hiddev_fops = { 750static const struct file_operations hiddev_fops = {
742 .owner = THIS_MODULE, 751 .owner = THIS_MODULE,
743 .read = hiddev_read, 752 .read = hiddev_read,
@@ -747,6 +756,9 @@ static const struct file_operations hiddev_fops = {
747 .release = hiddev_release, 756 .release = hiddev_release,
748 .ioctl = hiddev_ioctl, 757 .ioctl = hiddev_ioctl,
749 .fasync = hiddev_fasync, 758 .fasync = hiddev_fasync,
759#ifdef CONFIG_COMPAT
760 .compat_ioctl = hiddev_compat_ioctl,
761#endif
750}; 762};
751 763
752static struct usb_class_driver hiddev_class = { 764static struct usb_class_driver hiddev_class = {