diff options
Diffstat (limited to 'drivers/input/evdev.c')
-rw-r--r-- | drivers/input/evdev.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 5f561fce32d..4bf48188cc9 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
@@ -78,14 +78,19 @@ static int evdev_fasync(int fd, struct file *file, int on) | |||
78 | { | 78 | { |
79 | int retval; | 79 | int retval; |
80 | struct evdev_list *list = file->private_data; | 80 | struct evdev_list *list = file->private_data; |
81 | |||
81 | retval = fasync_helper(fd, file, on, &list->fasync); | 82 | retval = fasync_helper(fd, file, on, &list->fasync); |
83 | |||
82 | return retval < 0 ? retval : 0; | 84 | return retval < 0 ? retval : 0; |
83 | } | 85 | } |
84 | 86 | ||
85 | static int evdev_flush(struct file * file, fl_owner_t id) | 87 | static int evdev_flush(struct file *file, fl_owner_t id) |
86 | { | 88 | { |
87 | struct evdev_list *list = file->private_data; | 89 | struct evdev_list *list = file->private_data; |
88 | if (!list->evdev->exist) return -ENODEV; | 90 | |
91 | if (!list->evdev->exist) | ||
92 | return -ENODEV; | ||
93 | |||
89 | return input_flush_device(&list->evdev->handle, file); | 94 | return input_flush_device(&list->evdev->handle, file); |
90 | } | 95 | } |
91 | 96 | ||
@@ -122,14 +127,10 @@ static int evdev_open(struct inode * inode, struct file * file) | |||
122 | { | 127 | { |
123 | struct evdev_list *list; | 128 | struct evdev_list *list; |
124 | int i = iminor(inode) - EVDEV_MINOR_BASE; | 129 | int i = iminor(inode) - EVDEV_MINOR_BASE; |
125 | int accept_err; | ||
126 | 130 | ||
127 | if (i >= EVDEV_MINORS || !evdev_table[i] || !evdev_table[i]->exist) | 131 | if (i >= EVDEV_MINORS || !evdev_table[i] || !evdev_table[i]->exist) |
128 | return -ENODEV; | 132 | return -ENODEV; |
129 | 133 | ||
130 | if ((accept_err = input_accept_process(&(evdev_table[i]->handle), file))) | ||
131 | return accept_err; | ||
132 | |||
133 | if (!(list = kzalloc(sizeof(struct evdev_list), GFP_KERNEL))) | 134 | if (!(list = kzalloc(sizeof(struct evdev_list), GFP_KERNEL))) |
134 | return -ENOMEM; | 135 | return -ENOMEM; |
135 | 136 | ||
@@ -255,7 +256,7 @@ static ssize_t evdev_write(struct file * file, const char __user * buffer, size_ | |||
255 | 256 | ||
256 | if (evdev_event_from_user(buffer + retval, &event)) | 257 | if (evdev_event_from_user(buffer + retval, &event)) |
257 | return -EFAULT; | 258 | return -EFAULT; |
258 | input_event(list->evdev->handle.dev, event.type, event.code, event.value); | 259 | input_inject_event(&list->evdev->handle, event.type, event.code, event.value); |
259 | retval += evdev_event_size(); | 260 | retval += evdev_event_size(); |
260 | } | 261 | } |
261 | 262 | ||
@@ -300,6 +301,7 @@ static ssize_t evdev_read(struct file * file, char __user * buffer, size_t count | |||
300 | static unsigned int evdev_poll(struct file *file, poll_table *wait) | 301 | static unsigned int evdev_poll(struct file *file, poll_table *wait) |
301 | { | 302 | { |
302 | struct evdev_list *list = file->private_data; | 303 | struct evdev_list *list = file->private_data; |
304 | |||
303 | poll_wait(file, &list->evdev->wait, wait); | 305 | poll_wait(file, &list->evdev->wait, wait); |
304 | return ((list->head == list->tail) ? 0 : (POLLIN | POLLRDNORM)) | | 306 | return ((list->head == list->tail) ? 0 : (POLLIN | POLLRDNORM)) | |
305 | (list->evdev->exist ? 0 : (POLLHUP | POLLERR)); | 307 | (list->evdev->exist ? 0 : (POLLHUP | POLLERR)); |
@@ -422,8 +424,8 @@ static long evdev_ioctl_handler(struct file *file, unsigned int cmd, | |||
422 | if (get_user(v, ip + 1)) | 424 | if (get_user(v, ip + 1)) |
423 | return -EFAULT; | 425 | return -EFAULT; |
424 | 426 | ||
425 | input_event(dev, EV_REP, REP_DELAY, u); | 427 | input_inject_event(&evdev->handle, EV_REP, REP_DELAY, u); |
426 | input_event(dev, EV_REP, REP_PERIOD, v); | 428 | input_inject_event(&evdev->handle, EV_REP, REP_PERIOD, v); |
427 | 429 | ||
428 | return 0; | 430 | return 0; |
429 | 431 | ||