| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2001 Paul Stewart |
|---|
| 3 | 4 | * Copyright (c) 2001 Vojtech Pavlik |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * HID char devices, giving access to raw HID device events. |
|---|
| 6 | | - * |
|---|
| 7 | 7 | */ |
|---|
| 8 | 8 | |
|---|
| 9 | 9 | /* |
|---|
| 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 |
|---|
| 23 | 10 | * |
|---|
| 24 | 11 | * Should you need to contact me, the author, you can do so either by |
|---|
| 25 | 12 | * e-mail - mail your message to Paul Stewart <stewart@wetlogic.net> |
|---|
| .. | .. |
|---|
| 428 | 415 | |
|---|
| 429 | 416 | poll_wait(file, &list->hiddev->wait, wait); |
|---|
| 430 | 417 | if (list->head != list->tail) |
|---|
| 431 | | - return EPOLLIN | EPOLLRDNORM; |
|---|
| 418 | + return EPOLLIN | EPOLLRDNORM | EPOLLOUT; |
|---|
| 432 | 419 | if (!list->hiddev->exist) |
|---|
| 433 | 420 | return EPOLLERR | EPOLLHUP; |
|---|
| 434 | 421 | return 0; |
|---|
| .. | .. |
|---|
| 798 | 785 | break; |
|---|
| 799 | 786 | |
|---|
| 800 | 787 | case HIDIOCGUCODE: |
|---|
| 801 | | - /* fall through */ |
|---|
| 802 | 788 | case HIDIOCGUSAGE: |
|---|
| 803 | 789 | case HIDIOCSUSAGE: |
|---|
| 804 | 790 | case HIDIOCGUSAGES: |
|---|
| .. | .. |
|---|
| 858 | 844 | return r; |
|---|
| 859 | 845 | } |
|---|
| 860 | 846 | |
|---|
| 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 | | - |
|---|
| 868 | 847 | static const struct file_operations hiddev_fops = { |
|---|
| 869 | 848 | .owner = THIS_MODULE, |
|---|
| 870 | 849 | .read = hiddev_read, |
|---|
| .. | .. |
|---|
| 874 | 853 | .release = hiddev_release, |
|---|
| 875 | 854 | .unlocked_ioctl = hiddev_ioctl, |
|---|
| 876 | 855 | .fasync = hiddev_fasync, |
|---|
| 877 | | -#ifdef CONFIG_COMPAT |
|---|
| 878 | | - .compat_ioctl = hiddev_compat_ioctl, |
|---|
| 879 | | -#endif |
|---|
| 856 | + .compat_ioctl = compat_ptr_ioctl, |
|---|
| 880 | 857 | .llseek = noop_llseek, |
|---|
| 881 | 858 | }; |
|---|
| 882 | 859 | |
|---|