hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/misc/cxl/debugfs.c
....@@ -1,10 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright 2014 IBM Corp.
3
- *
4
- * This program is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU General Public License
6
- * as published by the Free Software Foundation; either version
7
- * 2 of the License, or (at your option) any later version.
84 */
95
106 #include <linux/debugfs.h>
....@@ -30,11 +26,11 @@
3026 DEFINE_DEBUGFS_ATTRIBUTE(fops_io_x64, debugfs_io_u64_get, debugfs_io_u64_set,
3127 "0x%016llx\n");
3228
33
-static struct dentry *debugfs_create_io_x64(const char *name, umode_t mode,
34
- struct dentry *parent, u64 __iomem *value)
29
+static void debugfs_create_io_x64(const char *name, umode_t mode,
30
+ struct dentry *parent, u64 __iomem *value)
3531 {
36
- return debugfs_create_file_unsafe(name, mode, parent,
37
- (void __force *)value, &fops_io_x64);
32
+ debugfs_create_file_unsafe(name, mode, parent, (void __force *)value,
33
+ &fops_io_x64);
3834 }
3935
4036 void cxl_debugfs_add_adapter_regs_psl9(struct cxl *adapter, struct dentry *dir)
....@@ -58,25 +54,22 @@
5854 debugfs_create_io_x64("trace", S_IRUSR | S_IWUSR, dir, _cxl_p1_addr(adapter, CXL_PSL_TRACE));
5955 }
6056
61
-int cxl_debugfs_adapter_add(struct cxl *adapter)
57
+void cxl_debugfs_adapter_add(struct cxl *adapter)
6258 {
6359 struct dentry *dir;
6460 char buf[32];
6561
6662 if (!cxl_debugfs)
67
- return -ENODEV;
63
+ return;
6864
6965 snprintf(buf, 32, "card%i", adapter->adapter_num);
7066 dir = debugfs_create_dir(buf, cxl_debugfs);
71
- if (IS_ERR(dir))
72
- return PTR_ERR(dir);
7367 adapter->debugfs = dir;
7468
7569 debugfs_create_io_x64("err_ivte", S_IRUSR, dir, _cxl_p1_addr(adapter, CXL_PSL_ErrIVTE));
7670
7771 if (adapter->native->sl_ops->debugfs_add_adapter_regs)
7872 adapter->native->sl_ops->debugfs_add_adapter_regs(adapter, dir);
79
- return 0;
8073 }
8174
8275 void cxl_debugfs_adapter_remove(struct cxl *adapter)
....@@ -100,18 +93,16 @@
10093 debugfs_create_io_x64("trace", S_IRUSR | S_IWUSR, dir, _cxl_p1n_addr(afu, CXL_PSL_SLICE_TRACE));
10194 }
10295
103
-int cxl_debugfs_afu_add(struct cxl_afu *afu)
96
+void cxl_debugfs_afu_add(struct cxl_afu *afu)
10497 {
10598 struct dentry *dir;
10699 char buf[32];
107100
108101 if (!afu->adapter->debugfs)
109
- return -ENODEV;
102
+ return;
110103
111104 snprintf(buf, 32, "psl%i.%i", afu->adapter->adapter_num, afu->slice);
112105 dir = debugfs_create_dir(buf, afu->adapter->debugfs);
113
- if (IS_ERR(dir))
114
- return PTR_ERR(dir);
115106 afu->debugfs = dir;
116107
117108 debugfs_create_io_x64("sr", S_IRUSR, dir, _cxl_p1n_addr(afu, CXL_PSL_SR_An));
....@@ -122,8 +113,6 @@
122113
123114 if (afu->adapter->native->sl_ops->debugfs_add_afu_regs)
124115 afu->adapter->native->sl_ops->debugfs_add_afu_regs(afu, dir);
125
-
126
- return 0;
127116 }
128117
129118 void cxl_debugfs_afu_remove(struct cxl_afu *afu)
....@@ -131,19 +120,12 @@
131120 debugfs_remove_recursive(afu->debugfs);
132121 }
133122
134
-int __init cxl_debugfs_init(void)
123
+void __init cxl_debugfs_init(void)
135124 {
136
- struct dentry *ent;
137
-
138125 if (!cpu_has_feature(CPU_FTR_HVMODE))
139
- return 0;
126
+ return;
140127
141
- ent = debugfs_create_dir("cxl", NULL);
142
- if (IS_ERR(ent))
143
- return PTR_ERR(ent);
144
- cxl_debugfs = ent;
145
-
146
- return 0;
128
+ cxl_debugfs = debugfs_create_dir("cxl", NULL);
147129 }
148130
149131 void cxl_debugfs_exit(void)