aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/evdev.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2010-07-16 02:28:42 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-07-16 02:53:00 -0400
commitc18fb1396eb809dbc16e51da273a1789f9d799bf (patch)
tree43a8f5a321dc625e4cf269a68ccd72fe3b93bcba /drivers/input/evdev.c
parent4d4bf995ea873cc213c5abc5402af46ef490b8fd (diff)
Input: evdev - signal that device is writable in evdev_poll()
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/evdev.c')
-rw-r--r--drivers/input/evdev.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 70c0eb52ca96..054edf346e0b 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)
403{ 403{
404 struct evdev_client *client = file->private_data; 404 struct evdev_client *client = file->private_data;
405 struct evdev *evdev = client->evdev; 405 struct evdev *evdev = client->evdev;
406 unsigned int mask;
406 407
407 poll_wait(file, &evdev->wait, wait); 408 poll_wait(file, &evdev->wait, wait);
408 return ((client->head == client->tail) ? 0 : (POLLIN | POLLRDNORM)) | 409
409 (evdev->exist ? 0 : (POLLHUP | POLLERR)); 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#ifdef CONFIG_COMPAT 417#ifdef CONFIG_COMPAT