From d135987d5a465982aa3862b8f043c65c629cc27b Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 15 Jul 2010 23:28:42 -0700 Subject: [PATCH] --- yaml --- r: 202218 b: refs/heads/master c: c18fb1396eb809dbc16e51da273a1789f9d799bf h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/input/evdev.c | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index e596ff5b9d65..c622b372f26e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4d4bf995ea873cc213c5abc5402af46ef490b8fd +refs/heads/master: c18fb1396eb809dbc16e51da273a1789f9d799bf diff --git a/trunk/drivers/input/evdev.c b/trunk/drivers/input/evdev.c index 70c0eb52ca96..054edf346e0b 100644 --- a/trunk/drivers/input/evdev.c +++ b/trunk/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