]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/hid/hidraw.c
HID: hidraw, uhid: Always report EPOLLOUT
[linux.git] / drivers / hid / hidraw.c
index 9432670671feb10a8309a5bfb5a01dad4e0bb060..7a75aff78388289f0ac4164b2acb25b96ed78dd5 100644 (file)
@@ -249,13 +249,14 @@ static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t
 static __poll_t hidraw_poll(struct file *file, poll_table *wait)
 {
        struct hidraw_list *list = file->private_data;
+       __poll_t mask = EPOLLOUT | EPOLLWRNORM; /* hidraw is always writable */
 
        poll_wait(file, &list->hidraw->wait, wait);
        if (list->head != list->tail)
-               return EPOLLIN | EPOLLRDNORM | EPOLLOUT;
+               mask |= EPOLLIN | EPOLLRDNORM;
        if (!list->hidraw->exist)
-               return EPOLLERR | EPOLLHUP;
-       return 0;
+               mask |= EPOLLERR | EPOLLHUP;
+       return mask;
 }
 
 static int hidraw_open(struct inode *inode, struct file *file)
@@ -468,9 +469,7 @@ static const struct file_operations hidraw_ops = {
        .release =      hidraw_release,
        .unlocked_ioctl = hidraw_ioctl,
        .fasync =       hidraw_fasync,
-#ifdef CONFIG_COMPAT
-       .compat_ioctl   = hidraw_ioctl,
-#endif
+       .compat_ioctl   = compat_ptr_ioctl,
        .llseek =       noop_llseek,
 };