aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mousedev.c
diff options
context:
space:
mode:
authorJulien Moutinho <julm+linux@savines.alpes.fr.eu.org>2010-07-16 02:27:56 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-07-16 02:52:52 -0400
commit4d4bf995ea873cc213c5abc5402af46ef490b8fd (patch)
treeae150da8d3053ce30f49509c8c030c6a9c53ccef /drivers/input/mousedev.c
parent20da92de8ec3c1d4ba7e5aca322d38b6ce634932 (diff)
Input: mousedev - signal that device is writable in mousedev_poll()
The Microsoft ImPS/2 mouse protocol being bidirectionnal (sic) one may have to write in /dev/input/mice; and that works better if select() does not hang. Signed-off-by: Julien Moutinho <julm+linux@savines.alpes.fr.eu.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mousedev.c')
-rw-r--r--drivers/input/mousedev.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index d7a7a2fce74..d8f68f77007 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
774static const struct file_operations mousedev_fops = { 779static const struct file_operations mousedev_fops = {