]> err.no Git - linux-2.6/blobdiff - drivers/input/evdev.c
[PATCH] 3c59x: read current link status from phy
[linux-2.6] / drivers / input / evdev.c
index d62c73f5ba93d4f55040230ea139ef531b023d9e..f8b278d3559bc2b3553d8949192ee1ce6494bc78 100644 (file)
@@ -160,6 +160,8 @@ struct input_event_compat {
 #  define COMPAT_TEST IS_IA32_PROCESS(ia64_task_regs(current))
 #elif defined(CONFIG_ARCH_S390)
 #  define COMPAT_TEST test_thread_flag(TIF_31BIT)
+#elif defined(CONFIG_MIPS)
+#  define COMPAT_TEST (current->thread.mflags & MF_32BIT_ADDR)
 #else
 #  define COMPAT_TEST test_thread_flag(TIF_32BIT)
 #endif
@@ -320,6 +322,7 @@ static long evdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                        if (t < 0 || t >= dev->keycodemax || !dev->keycodesize) return -EINVAL;
                        if (get_user(v, ip + 1)) return -EFAULT;
                        if (v < 0 || v > KEY_MAX) return -EINVAL;
+                       if (v >> (dev->keycodesize * 8)) return -EINVAL;
                        u = SET_INPUT_KEYCODE(dev, t, v);
                        clear_bit(u, dev->keybit);
                        set_bit(v, dev->keybit);
@@ -678,9 +681,9 @@ static struct input_handle *evdev_connect(struct input_handler *handler, struct
 
        devfs_mk_cdev(MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor),
                        S_IFCHR|S_IRUGO|S_IWUSR, "input/event%d", minor);
-       class_simple_device_add(input_class,
-                               MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor),
-                               dev->dev, "event%d", minor);
+       class_device_create(input_class,
+                       MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor),
+                       dev->dev, "event%d", minor);
 
        return &evdev->handle;
 }
@@ -690,7 +693,8 @@ static void evdev_disconnect(struct input_handle *handle)
        struct evdev *evdev = handle->private;
        struct evdev_list *list;
 
-       class_simple_device_remove(MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + evdev->minor));
+       class_device_destroy(input_class,
+                       MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + evdev->minor));
        devfs_remove("input/event%d", evdev->minor);
        evdev->exist = 0;