Commit c18fb1396eb809dbc16e51da273a1789f9d799bf
1 parent
4d4bf995ea
Input: evdev - signal that device is writable in evdev_poll()
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Showing 1 changed file with 7 additions and 2 deletions Side-by-side Diff
drivers/input/evdev.c
... | ... | @@ -403,10 +403,15 @@ |
403 | 403 | { |
404 | 404 | struct evdev_client *client = file->private_data; |
405 | 405 | struct evdev *evdev = client->evdev; |
406 | + unsigned int mask; | |
406 | 407 | |
407 | 408 | poll_wait(file, &evdev->wait, wait); |
408 | - return ((client->head == client->tail) ? 0 : (POLLIN | POLLRDNORM)) | | |
409 | - (evdev->exist ? 0 : (POLLHUP | POLLERR)); | |
409 | + | |
410 | + mask = evdev->exist ? POLLOUT | POLLWRNORM : POLLHUP | POLLERR; | |
411 | + if (client->head != client->tail) | |
412 | + mask |= POLLIN | POLLRDNORM; | |
413 | + | |
414 | + return mask; | |
410 | 415 | } |
411 | 416 | |
412 | 417 | #ifdef CONFIG_COMPAT |