]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/input/mousedev.c
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux...
[karo-tx-linux.git] / drivers / input / mousedev.c
index d7a7a2fce745e5f448f67b4887b3abb1a3f03b27..d8f68f77007b6c1429b1c821509914bd10ee55a9 100644 (file)
@@ -765,10 +765,15 @@ static unsigned int mousedev_poll(struct file *file, poll_table *wait)
 {
        struct mousedev_client *client = file->private_data;
        struct mousedev *mousedev = client->mousedev;
+       unsigned int mask;
 
        poll_wait(file, &mousedev->wait, wait);
-       return ((client->ready || client->buffer) ? (POLLIN | POLLRDNORM) : 0) |
-               (mousedev->exist ? 0 : (POLLHUP | POLLERR));
+
+       mask = mousedev->exist ? POLLOUT | POLLWRNORM : POLLHUP | POLLERR;
+       if (client->ready || client->buffer)
+               mask |= POLLIN | POLLRDNORM;
+
+       return mask;
 }
 
 static const struct file_operations mousedev_fops = {