| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * User level driver support for input subsystem |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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 |
|---|
| 19 | 6 | * |
|---|
| 20 | 7 | * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> |
|---|
| 21 | 8 | * |
|---|
| .. | .. |
|---|
| 402 | 389 | newdev->state = UIST_NEW_DEVICE; |
|---|
| 403 | 390 | |
|---|
| 404 | 391 | file->private_data = newdev; |
|---|
| 405 | | - nonseekable_open(inode, file); |
|---|
| 392 | + stream_open(inode, file); |
|---|
| 406 | 393 | |
|---|
| 407 | 394 | return 0; |
|---|
| 408 | 395 | } |
|---|
| .. | .. |
|---|
| 706 | 693 | static __poll_t uinput_poll(struct file *file, poll_table *wait) |
|---|
| 707 | 694 | { |
|---|
| 708 | 695 | struct uinput_device *udev = file->private_data; |
|---|
| 696 | + __poll_t mask = EPOLLOUT | EPOLLWRNORM; /* uinput is always writable */ |
|---|
| 709 | 697 | |
|---|
| 710 | 698 | poll_wait(file, &udev->waitq, wait); |
|---|
| 711 | 699 | |
|---|
| 712 | 700 | if (udev->head != udev->tail) |
|---|
| 713 | | - return EPOLLIN | EPOLLRDNORM; |
|---|
| 701 | + mask |= EPOLLIN | EPOLLRDNORM; |
|---|
| 714 | 702 | |
|---|
| 715 | | - return 0; |
|---|
| 703 | + return mask; |
|---|
| 716 | 704 | } |
|---|
| 717 | 705 | |
|---|
| 718 | 706 | static int uinput_release(struct inode *inode, struct file *file) |
|---|