hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/net/wireless/st/cw1200/debug.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * mac80211 glue code for mac80211 ST-Ericsson CW1200 drivers
34 * DebugFS code
45 *
56 * Copyright (c) 2010, ST-Ericsson
67 * Author: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129
1310 #include <linux/module.h>
....@@ -289,19 +286,7 @@
289286 return 0;
290287 }
291288
292
-static int cw1200_status_open(struct inode *inode, struct file *file)
293
-{
294
- return single_open(file, &cw1200_status_show,
295
- inode->i_private);
296
-}
297
-
298
-static const struct file_operations fops_status = {
299
- .open = cw1200_status_open,
300
- .read = seq_read,
301
- .llseek = seq_lseek,
302
- .release = single_release,
303
- .owner = THIS_MODULE,
304
-};
289
+DEFINE_SHOW_ATTRIBUTE(cw1200_status);
305290
306291 static int cw1200_counters_show(struct seq_file *seq, void *v)
307292 {
....@@ -345,19 +330,7 @@
345330 return 0;
346331 }
347332
348
-static int cw1200_counters_open(struct inode *inode, struct file *file)
349
-{
350
- return single_open(file, &cw1200_counters_show,
351
- inode->i_private);
352
-}
353
-
354
-static const struct file_operations fops_counters = {
355
- .open = cw1200_counters_open,
356
- .read = seq_read,
357
- .llseek = seq_lseek,
358
- .release = single_release,
359
- .owner = THIS_MODULE,
360
-};
333
+DEFINE_SHOW_ATTRIBUTE(cw1200_counters);
361334
362335 static ssize_t cw1200_wsm_dumps(struct file *file,
363336 const char __user *user_buf, size_t count, loff_t *ppos)
....@@ -395,28 +368,14 @@
395368
396369 d->debugfs_phy = debugfs_create_dir("cw1200",
397370 priv->hw->wiphy->debugfsdir);
398
- if (!d->debugfs_phy)
399
- goto err;
400
-
401
- if (!debugfs_create_file("status", 0400, d->debugfs_phy,
402
- priv, &fops_status))
403
- goto err;
404
-
405
- if (!debugfs_create_file("counters", 0400, d->debugfs_phy,
406
- priv, &fops_counters))
407
- goto err;
408
-
409
- if (!debugfs_create_file("wsm_dumps", 0200, d->debugfs_phy,
410
- priv, &fops_wsm_dumps))
411
- goto err;
371
+ debugfs_create_file("status", 0400, d->debugfs_phy, priv,
372
+ &cw1200_status_fops);
373
+ debugfs_create_file("counters", 0400, d->debugfs_phy, priv,
374
+ &cw1200_counters_fops);
375
+ debugfs_create_file("wsm_dumps", 0200, d->debugfs_phy, priv,
376
+ &fops_wsm_dumps);
412377
413378 return 0;
414
-
415
-err:
416
- priv->debug = NULL;
417
- debugfs_remove_recursive(d->debugfs_phy);
418
- kfree(d);
419
- return ret;
420379 }
421380
422381 void cw1200_debug_release(struct cw1200_common *priv)