Skip to content

Commit

Permalink
Input: evdev - signal that device is writable in evdev_poll()
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Dmitry Torokhov committed Jul 16, 2010
1 parent 4d4bf99 commit c18fb13
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/input/evdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,15 @@ static unsigned int evdev_poll(struct file *file, poll_table *wait)
{
struct evdev_client *client = file->private_data;
struct evdev *evdev = client->evdev;
unsigned int mask;

poll_wait(file, &evdev->wait, wait);
return ((client->head == client->tail) ? 0 : (POLLIN | POLLRDNORM)) |
(evdev->exist ? 0 : (POLLHUP | POLLERR));

mask = evdev->exist ? POLLOUT | POLLWRNORM : POLLHUP | POLLERR;
if (client->head != client->tail)
mask |= POLLIN | POLLRDNORM;

return mask;
}

#ifdef CONFIG_COMPAT
Expand Down

0 comments on commit c18fb13

Please sign in to comment.