hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/input/misc/uinput.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * User level driver support for input subsystem
34 *
45 * Heavily based on evdev.c by Vojtech Pavlik
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
196 *
207 * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
218 *
....@@ -402,7 +389,7 @@
402389 newdev->state = UIST_NEW_DEVICE;
403390
404391 file->private_data = newdev;
405
- nonseekable_open(inode, file);
392
+ stream_open(inode, file);
406393
407394 return 0;
408395 }
....@@ -706,13 +693,14 @@
706693 static __poll_t uinput_poll(struct file *file, poll_table *wait)
707694 {
708695 struct uinput_device *udev = file->private_data;
696
+ __poll_t mask = EPOLLOUT | EPOLLWRNORM; /* uinput is always writable */
709697
710698 poll_wait(file, &udev->waitq, wait);
711699
712700 if (udev->head != udev->tail)
713
- return EPOLLIN | EPOLLRDNORM;
701
+ mask |= EPOLLIN | EPOLLRDNORM;
714702
715
- return 0;
703
+ return mask;
716704 }
717705
718706 static int uinput_release(struct inode *inode, struct file *file)