From: Dmitry Torokhov Date: Fri, 16 Jul 2010 06:28:42 +0000 (-0700) Subject: Input: evdev - signal that device is writable in evdev_poll() X-Git-Tag: firefly_0821_release~9833^2~1027^2~1^2~9 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c18fb1396eb809dbc16e51da273a1789f9d799bf;p=firefly-linux-kernel-4.4.55.git Input: evdev - signal that device is writable in evdev_poll() Signed-off-by: Dmitry Torokhov --- 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) { 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