]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/hid/hidraw.c
HID: hidraw, uhid: Always report EPOLLOUT
[mirror_ubuntu-bionic-kernel.git] / drivers / hid / hidraw.c
index 1abf5008def0b1f8b3b1c5e6c3061f404cf6e8de..5243c412081917e2f452e48bd01d48539595ef4a 100644 (file)
@@ -257,13 +257,14 @@ out:
 static unsigned int hidraw_poll(struct file *file, poll_table *wait)
 {
        struct hidraw_list *list = file->private_data;
+       unsigned int mask = POLLOUT | POLLWRNORM; /* hidraw is always writable */
 
        poll_wait(file, &list->hidraw->wait, wait);
        if (list->head != list->tail)
-               return POLLIN | POLLRDNORM;
+               mask |= POLLIN | POLLRDNORM;
        if (!list->hidraw->exist)
-               return POLLERR | POLLHUP;
-       return POLLOUT | POLLWRNORM;
+               mask |= POLLERR | POLLHUP;
+       return mask;
 }
 
 static int hidraw_open(struct inode *inode, struct file *file)