hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/wireless/broadcom/brcm80211/brcmsmac/debug.c
....@@ -37,33 +37,23 @@
3737 void brcms_debugfs_init(void)
3838 {
3939 root_folder = debugfs_create_dir(KBUILD_MODNAME, NULL);
40
- if (IS_ERR(root_folder))
41
- root_folder = NULL;
4240 }
4341
4442 void brcms_debugfs_exit(void)
4543 {
46
- if (!root_folder)
47
- return;
48
-
4944 debugfs_remove_recursive(root_folder);
5045 root_folder = NULL;
5146 }
5247
53
-int brcms_debugfs_attach(struct brcms_pub *drvr)
48
+void brcms_debugfs_attach(struct brcms_pub *drvr)
5449 {
55
- if (!root_folder)
56
- return -ENODEV;
57
-
5850 drvr->dbgfs_dir = debugfs_create_dir(
5951 dev_name(&drvr->wlc->hw->d11core->dev), root_folder);
60
- return PTR_ERR_OR_ZERO(drvr->dbgfs_dir);
6152 }
6253
6354 void brcms_debugfs_detach(struct brcms_pub *drvr)
6455 {
65
- if (!IS_ERR_OR_NULL(drvr->dbgfs_dir))
66
- debugfs_remove_recursive(drvr->dbgfs_dir);
56
+ debugfs_remove_recursive(drvr->dbgfs_dir);
6757 }
6858
6959 struct dentry *brcms_debugfs_get_devdir(struct brcms_pub *drvr)
....@@ -196,7 +186,7 @@
196186 .llseek = seq_lseek
197187 };
198188
199
-static int
189
+static void
200190 brcms_debugfs_add_entry(struct brcms_pub *drvr, const char *fn,
201191 int (*read_fn)(struct seq_file *seq, void *data))
202192 {
....@@ -204,27 +194,18 @@
204194 struct dentry *dentry = drvr->dbgfs_dir;
205195 struct brcms_debugfs_entry *entry;
206196
207
- if (IS_ERR_OR_NULL(dentry))
208
- return -ENOENT;
209
-
210197 entry = devm_kzalloc(dev, sizeof(*entry), GFP_KERNEL);
211198 if (!entry)
212
- return -ENOMEM;
199
+ return;
213200
214201 entry->read = read_fn;
215202 entry->drvr = drvr;
216203
217
- dentry = debugfs_create_file(fn, 0444, dentry, entry,
218
- &brcms_debugfs_def_ops);
219
-
220
- return PTR_ERR_OR_ZERO(dentry);
204
+ debugfs_create_file(fn, 0444, dentry, entry, &brcms_debugfs_def_ops);
221205 }
222206
223207 void brcms_debugfs_create_files(struct brcms_pub *drvr)
224208 {
225
- if (IS_ERR_OR_NULL(drvr->dbgfs_dir))
226
- return;
227
-
228209 brcms_debugfs_add_entry(drvr, "hardware", brcms_debugfs_hardware_read);
229210 brcms_debugfs_add_entry(drvr, "macstat", brcms_debugfs_macstat_read);
230211 }