summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2012-01-10 00:45:12 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-01-10 23:13:21 -0800
commit0c62fbf6009fa338bd28bdcb14efbfc5fc0c579b (patch)
tree9f36ade52c7004e7dc8adc61b10e4c5d596aa009 /drivers/input
parentd89c9bcb33909568905ec9c4b44a18cd8bd88aaa (diff)
Input: serio_raw - really signal HUP upon disconnect
Commit 8c1c10d5706bbb3b41cb4a5578339d67d3eeffc2 attempted to signal POLLHUP | POLLERR condition when polling disconnected device, unfortunately it did not do it quite correctly. Reported-by: Che-Liang Chiou <clchiou@chromium.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/serio/serio_raw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c
index ca78a890c75..f6c83e9ecff 100644
--- a/drivers/input/serio/serio_raw.c
+++ b/drivers/input/serio/serio_raw.c
@@ -237,9 +237,9 @@ static unsigned int serio_raw_poll(struct file *file, poll_table *wait)
mask = serio_raw->dead ? POLLHUP | POLLERR : POLLOUT | POLLWRNORM;
if (serio_raw->head != serio_raw->tail)
- return POLLIN | POLLRDNORM;
+ mask |= POLLIN | POLLRDNORM;
- return 0;
+ return mask;
}
static const struct file_operations serio_raw_fops = {