Merge branch 'cec-defines' into for-linus
[cascardo/linux.git] / drivers / input / misc / uinput.c
index 4eb9e4d..65ebbd1 100644 (file)
@@ -664,7 +664,7 @@ struct uinput_ff_upload_compat {
 static int uinput_ff_upload_to_user(char __user *buffer,
                                    const struct uinput_ff_upload *ff_up)
 {
-       if (INPUT_COMPAT_TEST) {
+       if (in_compat_syscall()) {
                struct uinput_ff_upload_compat ff_up_compat;
 
                ff_up_compat.request_id = ff_up->request_id;
@@ -695,7 +695,7 @@ static int uinput_ff_upload_to_user(char __user *buffer,
 static int uinput_ff_upload_from_user(const char __user *buffer,
                                      struct uinput_ff_upload *ff_up)
 {
-       if (INPUT_COMPAT_TEST) {
+       if (in_compat_syscall()) {
                struct uinput_ff_upload_compat ff_up_compat;
 
                if (copy_from_user(&ff_up_compat, buffer,
@@ -981,9 +981,15 @@ static long uinput_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 }
 
 #ifdef CONFIG_COMPAT
+
+#define UI_SET_PHYS_COMPAT     _IOW(UINPUT_IOCTL_BASE, 108, compat_uptr_t)
+
 static long uinput_compat_ioctl(struct file *file,
                                unsigned int cmd, unsigned long arg)
 {
+       if (cmd == UI_SET_PHYS_COMPAT)
+               cmd = UI_SET_PHYS;
+
        return uinput_ioctl_handler(file, cmd, arg, compat_ptr(arg));
 }
 #endif