hc
2024-09-20 a36159eec6ca17402b0e146b86efaf76568dc353
kernel/drivers/net/fjes/fjes_debugfs.c
....@@ -1,22 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * FUJITSU Extended Socket Network Device driver
34 * Copyright (c) 2015-2016 FUJITSU LIMITED
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
14
- * You should have received a copy of the GNU General Public License along with
15
- * this program; if not, see <http://www.gnu.org/licenses/>.
16
- *
17
- * The full GNU General Public License is included in this distribution in
18
- * the file called "COPYING".
19
- *
205 */
216
227 /* debugfs support for fjes driver */
....@@ -62,37 +47,16 @@
6247
6348 return 0;
6449 }
65
-
66
-static int fjes_dbg_status_open(struct inode *inode, struct file *file)
67
-{
68
- return single_open(file, fjes_dbg_status_show, inode->i_private);
69
-}
70
-
71
-static const struct file_operations fjes_dbg_status_fops = {
72
- .owner = THIS_MODULE,
73
- .open = fjes_dbg_status_open,
74
- .read = seq_read,
75
- .llseek = seq_lseek,
76
- .release = single_release,
77
-};
50
+DEFINE_SHOW_ATTRIBUTE(fjes_dbg_status);
7851
7952 void fjes_dbg_adapter_init(struct fjes_adapter *adapter)
8053 {
8154 const char *name = dev_name(&adapter->plat_dev->dev);
82
- struct dentry *pfile;
8355
8456 adapter->dbg_adapter = debugfs_create_dir(name, fjes_debug_root);
85
- if (!adapter->dbg_adapter) {
86
- dev_err(&adapter->plat_dev->dev,
87
- "debugfs entry for %s failed\n", name);
88
- return;
89
- }
9057
91
- pfile = debugfs_create_file("status", 0444, adapter->dbg_adapter,
92
- adapter, &fjes_dbg_status_fops);
93
- if (!pfile)
94
- dev_err(&adapter->plat_dev->dev,
95
- "debugfs status for %s failed\n", name);
58
+ debugfs_create_file("status", 0444, adapter->dbg_adapter, adapter,
59
+ &fjes_dbg_status_fops);
9660 }
9761
9862 void fjes_dbg_adapter_exit(struct fjes_adapter *adapter)
....@@ -104,8 +68,6 @@
10468 void fjes_dbg_init(void)
10569 {
10670 fjes_debug_root = debugfs_create_dir(fjes_driver_name, NULL);
107
- if (!fjes_debug_root)
108
- pr_info("init of debugfs failed\n");
10971 }
11072
11173 void fjes_dbg_exit(void)