summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorFabian Henneke <fabian.henneke@gmail.com>2019-07-09 13:03:37 +0200
committerJiri Kosina <jkosina@suse.cz>2019-08-05 14:07:13 +0200
commit378b80370aa1fe50f9c48a3ac8af3e416e73b89f (patch)
tree3e879f130ef0b40c1d3c857cce17f6bbbd79aca8 /drivers/hid
parent4832a4dada1a2baefac76b70e4f3a78e71a7c35c (diff)
downloadlinux-378b80370aa1fe50f9c48a3ac8af3e416e73b89f.tar.gz
linux-378b80370aa1fe50f9c48a3ac8af3e416e73b89f.tar.bz2
linux-378b80370aa1fe50f9c48a3ac8af3e416e73b89f.zip
hidraw: Return EPOLLOUT from hidraw_poll
Always return EPOLLOUT from hidraw_poll when a device is connected. This is safe since writes are always possible (but will always block). hidraw does not support non-blocking writes and instead always calls blocking backend functions on write requests. Hence, so far, a call to poll never returned EPOLLOUT, which confuses tools like socat. Signed-off-by: Fabian Henneke <fabian.henneke@gmail.com> In-reply-to: <CA+hv5qkyis03CgYTWeWX9cr0my-d2Oe+aZo+mjmWRXgjrGqyrw@mail.gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hidraw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
index 006bd6f4f653..24f40a3ddded 100644
--- a/drivers/hid/hidraw.c
+++ b/drivers/hid/hidraw.c
@@ -252,7 +252,7 @@ static __poll_t hidraw_poll(struct file *file, poll_table *wait)
poll_wait(file, &list->hidraw->wait, wait);
if (list->head != list->tail)
- return EPOLLIN | EPOLLRDNORM;
+ return EPOLLIN | EPOLLRDNORM | EPOLLOUT;
if (!list->hidraw->exist)
return EPOLLERR | EPOLLHUP;
return 0;