hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/rfkill/core.c
....@@ -1,20 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2006 - 2007 Ivo van Doorn
34 * Copyright (C) 2007 Dmitry Torokhov
45 * Copyright 2009 Johannes Berg <johannes@sipsolutions.net>
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, see <http://www.gnu.org/licenses/>.
186 */
197
208 #include <linux/kernel.h>
....@@ -510,8 +498,8 @@
510498 /**
511499 * rfkill_is_epo_lock_active - returns true EPO is active
512500 *
513
- * Returns 0 (false) if there is NOT an active EPO contidion,
514
- * and 1 (true) if there is an active EPO contition, which
501
+ * Returns 0 (false) if there is NOT an active EPO condition,
502
+ * and 1 (true) if there is an active EPO condition, which
515503 * locks all radios in one of the BLOCKED states.
516504 *
517505 * Can be called in atomic context.
....@@ -888,6 +876,9 @@
888876
889877 rfkill->suspended = false;
890878
879
+ if (!rfkill->registered)
880
+ return 0;
881
+
891882 if (!rfkill->persistent) {
892883 cur = !!(rfkill->state & RFKILL_BLOCK_SW);
893884 rfkill_set_block(rfkill, cur);
....@@ -1146,7 +1137,7 @@
11461137
11471138 file->private_data = data;
11481139
1149
- return nonseekable_open(inode, file);
1140
+ return stream_open(inode, file);
11501141
11511142 free:
11521143 mutex_unlock(&data->mtx);
....@@ -1326,7 +1317,7 @@
13261317 .release = rfkill_fop_release,
13271318 #ifdef CONFIG_RFKILL_INPUT
13281319 .unlocked_ioctl = rfkill_fop_ioctl,
1329
- .compat_ioctl = rfkill_fop_ioctl,
1320
+ .compat_ioctl = compat_ptr_ioctl,
13301321 #endif
13311322 .llseek = no_llseek,
13321323 };