diff options
-rw-r--r-- | drivers/input/mousedev.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index d7a7a2fce745..d8f68f77007b 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c | |||
@@ -765,10 +765,15 @@ static unsigned int mousedev_poll(struct file *file, poll_table *wait) | |||
765 | { | 765 | { |
766 | struct mousedev_client *client = file->private_data; | 766 | struct mousedev_client *client = file->private_data; |
767 | struct mousedev *mousedev = client->mousedev; | 767 | struct mousedev *mousedev = client->mousedev; |
768 | unsigned int mask; | ||
768 | 769 | ||
769 | poll_wait(file, &mousedev->wait, wait); | 770 | poll_wait(file, &mousedev->wait, wait); |
770 | return ((client->ready || client->buffer) ? (POLLIN | POLLRDNORM) : 0) | | 771 | |
771 | (mousedev->exist ? 0 : (POLLHUP | POLLERR)); | 772 | mask = mousedev->exist ? POLLOUT | POLLWRNORM : POLLHUP | POLLERR; |
773 | if (client->ready || client->buffer) | ||
774 | mask |= POLLIN | POLLRDNORM; | ||
775 | |||
776 | return mask; | ||
772 | } | 777 | } |
773 | 778 | ||
774 | static const struct file_operations mousedev_fops = { | 779 | static const struct file_operations mousedev_fops = { |