hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/net/wimax/stack.c
....@@ -1,25 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Linux WiMAX
34 * Initialization, addition and removal of wimax devices
45 *
5
- *
66 * Copyright (C) 2005-2006 Intel Corporation <linux-wimax@intel.com>
77 * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU General Public License version
11
- * 2 as published by the Free Software Foundation.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software
20
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
- * 02110-1301, USA.
22
- *
238 *
249 * This implements:
2510 *
....@@ -416,29 +401,29 @@
416401 },
417402 };
418403
419
-static const struct genl_ops wimax_gnl_ops[] = {
404
+static const struct genl_small_ops wimax_gnl_ops[] = {
420405 {
421406 .cmd = WIMAX_GNL_OP_MSG_FROM_USER,
407
+ .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
422408 .flags = GENL_ADMIN_PERM,
423
- .policy = wimax_gnl_policy,
424409 .doit = wimax_gnl_doit_msg_from_user,
425410 },
426411 {
427412 .cmd = WIMAX_GNL_OP_RESET,
413
+ .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
428414 .flags = GENL_ADMIN_PERM,
429
- .policy = wimax_gnl_policy,
430415 .doit = wimax_gnl_doit_reset,
431416 },
432417 {
433418 .cmd = WIMAX_GNL_OP_RFKILL,
419
+ .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
434420 .flags = GENL_ADMIN_PERM,
435
- .policy = wimax_gnl_policy,
436421 .doit = wimax_gnl_doit_rfkill,
437422 },
438423 {
439424 .cmd = WIMAX_GNL_OP_STATE_GET,
425
+ .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
440426 .flags = GENL_ADMIN_PERM,
441
- .policy = wimax_gnl_policy,
442427 .doit = wimax_gnl_doit_state_get,
443428 },
444429 };
....@@ -496,12 +481,7 @@
496481 /* Set up user-space interaction */
497482 mutex_lock(&wimax_dev->mutex);
498483 wimax_id_table_add(wimax_dev);
499
- result = wimax_debugfs_add(wimax_dev);
500
- if (result < 0) {
501
- dev_err(dev, "cannot initialize debugfs: %d\n",
502
- result);
503
- goto error_debugfs_add;
504
- }
484
+ wimax_debugfs_add(wimax_dev);
505485
506486 __wimax_state_set(wimax_dev, WIMAX_ST_DOWN);
507487 mutex_unlock(&wimax_dev->mutex);
....@@ -513,10 +493,6 @@
513493 d_fnend(3, dev, "(wimax_dev %p net_dev %p) = 0\n", wimax_dev, net_dev);
514494 return 0;
515495
516
-error_debugfs_add:
517
- wimax_id_table_rm(wimax_dev);
518
- mutex_unlock(&wimax_dev->mutex);
519
- wimax_rfkill_rm(wimax_dev);
520496 error_rfkill_add:
521497 d_fnend(3, dev, "(wimax_dev %p net_dev %p) = %d\n",
522498 wimax_dev, net_dev, result);
....@@ -582,9 +558,10 @@
582558 .version = WIMAX_GNL_VERSION,
583559 .hdrsize = 0,
584560 .maxattr = WIMAX_GNL_ATTR_MAX,
561
+ .policy = wimax_gnl_policy,
585562 .module = THIS_MODULE,
586
- .ops = wimax_gnl_ops,
587
- .n_ops = ARRAY_SIZE(wimax_gnl_ops),
563
+ .small_ops = wimax_gnl_ops,
564
+ .n_small_ops = ARRAY_SIZE(wimax_gnl_ops),
588565 .mcgrps = wimax_gnl_mcgrps,
589566 .n_mcgrps = ARRAY_SIZE(wimax_gnl_mcgrps),
590567 };