hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/net/wireless/intel/iwlwifi/dvm/debugfs.c
....@@ -1,25 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /******************************************************************************
23 *
3
- * GPL LICENSE SUMMARY
4
- *
54 * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved.
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of version 2 of the GNU General Public License as
9
- * published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be useful, but
12
- * WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
19
- * USA
20
- *
21
- * The full GNU General Public License is included in this distribution
22
- * in the file called COPYING.
5
+ * Copyright (C) 2018 Intel Corporation
236 *
247 * Contact Information:
258 * Intel Linux Wireless <linuxwifi@intel.com>
....@@ -41,31 +24,8 @@
4124
4225 /* create and remove of files */
4326 #define DEBUGFS_ADD_FILE(name, parent, mode) do { \
44
- if (!debugfs_create_file(#name, mode, parent, priv, \
45
- &iwl_dbgfs_##name##_ops)) \
46
- goto err; \
47
-} while (0)
48
-
49
-#define DEBUGFS_ADD_BOOL(name, parent, ptr) do { \
50
- struct dentry *__tmp; \
51
- __tmp = debugfs_create_bool(#name, 0600, parent, ptr); \
52
- if (IS_ERR(__tmp) || !__tmp) \
53
- goto err; \
54
-} while (0)
55
-
56
-#define DEBUGFS_ADD_X32(name, parent, ptr) do { \
57
- struct dentry *__tmp; \
58
- __tmp = debugfs_create_x32(#name, 0600, parent, ptr); \
59
- if (IS_ERR(__tmp) || !__tmp) \
60
- goto err; \
61
-} while (0)
62
-
63
-#define DEBUGFS_ADD_U32(name, parent, ptr, mode) do { \
64
- struct dentry *__tmp; \
65
- __tmp = debugfs_create_u32(#name, mode, \
66
- parent, ptr); \
67
- if (IS_ERR(__tmp) || !__tmp) \
68
- goto err; \
27
+ debugfs_create_file(#name, mode, parent, priv, \
28
+ &iwl_dbgfs_##name##_ops); \
6929 } while (0)
7030
7131 /* file operation */
....@@ -2243,7 +2203,7 @@
22432203 buf_size = min(count, sizeof(buf) - 1);
22442204 if (copy_from_user(buf, user_buf, buf_size))
22452205 return -EFAULT;
2246
- if (sscanf(buf, "%d", &event_log_flag) != 1)
2206
+ if (sscanf(buf, "%u", &event_log_flag) != 1)
22472207 return -EFAULT;
22482208 if (event_log_flag == 1)
22492209 iwl_dump_nic_event_log(priv, true, NULL);
....@@ -2352,21 +2312,15 @@
23522312 * Create the debugfs files and directories
23532313 *
23542314 */
2355
-int iwl_dbgfs_register(struct iwl_priv *priv, struct dentry *dbgfs_dir)
2315
+void iwl_dbgfs_register(struct iwl_priv *priv, struct dentry *dbgfs_dir)
23562316 {
23572317 struct dentry *dir_data, *dir_rf, *dir_debug;
23582318
23592319 priv->debugfs_dir = dbgfs_dir;
23602320
23612321 dir_data = debugfs_create_dir("data", dbgfs_dir);
2362
- if (!dir_data)
2363
- goto err;
23642322 dir_rf = debugfs_create_dir("rf", dbgfs_dir);
2365
- if (!dir_rf)
2366
- goto err;
23672323 dir_debug = debugfs_create_dir("debug", dbgfs_dir);
2368
- if (!dir_debug)
2369
- goto err;
23702324
23712325 DEBUGFS_ADD_FILE(nvm, dir_data, 0400);
23722326 DEBUGFS_ADD_FILE(sram, dir_data, 0600);
....@@ -2426,13 +2380,6 @@
24262380
24272381 snprintf(buf, 100, "../../%pd2", dev_dir);
24282382
2429
- if (!debugfs_create_symlink("iwlwifi", mac80211_dir, buf))
2430
- goto err;
2383
+ debugfs_create_symlink("iwlwifi", mac80211_dir, buf);
24312384 }
2432
-
2433
- return 0;
2434
-
2435
-err:
2436
- IWL_ERR(priv, "failed to create the dvm debugfs entries\n");
2437
- return -ENOMEM;
24382385 }