hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/drivers/hid/usbhid/hiddev.c
....@@ -1,25 +1,12 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (c) 2001 Paul Stewart
34 * Copyright (c) 2001 Vojtech Pavlik
45 *
56 * HID char devices, giving access to raw HID device events.
6
- *
77 */
88
99 /*
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public License
21
- * along with this program; if not, write to the Free Software
22
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2310 *
2411 * Should you need to contact me, the author, you can do so either by
2512 * e-mail - mail your message to Paul Stewart <stewart@wetlogic.net>
....@@ -428,7 +415,7 @@
428415
429416 poll_wait(file, &list->hiddev->wait, wait);
430417 if (list->head != list->tail)
431
- return EPOLLIN | EPOLLRDNORM;
418
+ return EPOLLIN | EPOLLRDNORM | EPOLLOUT;
432419 if (!list->hiddev->exist)
433420 return EPOLLERR | EPOLLHUP;
434421 return 0;
....@@ -798,7 +785,6 @@
798785 break;
799786
800787 case HIDIOCGUCODE:
801
- /* fall through */
802788 case HIDIOCGUSAGE:
803789 case HIDIOCSUSAGE:
804790 case HIDIOCGUSAGES:
....@@ -858,13 +844,6 @@
858844 return r;
859845 }
860846
861
-#ifdef CONFIG_COMPAT
862
-static long hiddev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
863
-{
864
- return hiddev_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
865
-}
866
-#endif
867
-
868847 static const struct file_operations hiddev_fops = {
869848 .owner = THIS_MODULE,
870849 .read = hiddev_read,
....@@ -874,9 +853,7 @@
874853 .release = hiddev_release,
875854 .unlocked_ioctl = hiddev_ioctl,
876855 .fasync = hiddev_fasync,
877
-#ifdef CONFIG_COMPAT
878
- .compat_ioctl = hiddev_compat_ioctl,
879
-#endif
856
+ .compat_ioctl = compat_ptr_ioctl,
880857 .llseek = noop_llseek,
881858 };
882859