Skip to content

Commit c18fb13

Browse files
committed
Input: evdev - signal that device is writable in evdev_poll()
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
1 parent 4d4bf99 commit c18fb13

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎drivers/input/evdev.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,15 @@ static unsigned int evdev_poll(struct file *file, poll_table *wait)
403403
{
404404
struct evdev_client *client = file->private_data;
405405
struct evdev *evdev = client->evdev;
406+
unsigned int mask;
406407

407408
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;
410415
}
411416

412417
#ifdef CONFIG_COMPAT

0 commit comments

Comments
 (0)