diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-07-16 06:28:42 (GMT) |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-07-16 06:53:00 (GMT) |
commit | c18fb1396eb809dbc16e51da273a1789f9d799bf (patch) | |
tree | 43a8f5a321dc625e4cf269a68ccd72fe3b93bcba /drivers/input | |
parent | 4d4bf995ea873cc213c5abc5402af46ef490b8fd (diff) | |
download | linux-fsl-qoriq-c18fb1396eb809dbc16e51da273a1789f9d799bf.tar.xz |
Input: evdev - signal that device is writable in evdev_poll()
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/evdev.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 70c0eb5..054edf3 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c @@ -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 |