diff options
author | Yangtao Li <tiny.windzz@gmail.com> | 2018-12-03 08:31:45 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-12-20 08:46:32 +0200 |
commit | cc4dc97ffc69c253d5aa2c0068545ed6c8bc0bde (patch) | |
tree | b84baab1e85c948c6817cba1a5d61de51b89b0ea /drivers/net/wireless/st | |
parent | 30ed3c6c0922a1f67c3409b9e81087442614db7b (diff) | |
download | linux-stable-cc4dc97ffc69c253d5aa2c0068545ed6c8bc0bde.tar.gz linux-stable-cc4dc97ffc69c253d5aa2c0068545ed6c8bc0bde.tar.bz2 linux-stable-cc4dc97ffc69c253d5aa2c0068545ed6c8bc0bde.zip |
cw1200: convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/st')
-rw-r--r-- | drivers/net/wireless/st/cw1200/debug.c | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/drivers/net/wireless/st/cw1200/debug.c b/drivers/net/wireless/st/cw1200/debug.c index 295cb1a29f25..2231ba08bc1f 100644 --- a/drivers/net/wireless/st/cw1200/debug.c +++ b/drivers/net/wireless/st/cw1200/debug.c @@ -289,19 +289,7 @@ static int cw1200_status_show(struct seq_file *seq, void *v) return 0; } -static int cw1200_status_open(struct inode *inode, struct file *file) -{ - return single_open(file, &cw1200_status_show, - inode->i_private); -} - -static const struct file_operations fops_status = { - .open = cw1200_status_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .owner = THIS_MODULE, -}; +DEFINE_SHOW_ATTRIBUTE(cw1200_status); static int cw1200_counters_show(struct seq_file *seq, void *v) { @@ -345,19 +333,7 @@ static int cw1200_counters_show(struct seq_file *seq, void *v) return 0; } -static int cw1200_counters_open(struct inode *inode, struct file *file) -{ - return single_open(file, &cw1200_counters_show, - inode->i_private); -} - -static const struct file_operations fops_counters = { - .open = cw1200_counters_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, - .owner = THIS_MODULE, -}; +DEFINE_SHOW_ATTRIBUTE(cw1200_counters); static ssize_t cw1200_wsm_dumps(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) @@ -399,11 +375,11 @@ int cw1200_debug_init(struct cw1200_common *priv) goto err; if (!debugfs_create_file("status", 0400, d->debugfs_phy, - priv, &fops_status)) + priv, &cw1200_status_fops)) goto err; if (!debugfs_create_file("counters", 0400, d->debugfs_phy, - priv, &fops_counters)) + priv, &cw1200_counters_fops)) goto err; if (!debugfs_create_file("wsm_dumps", 0200, d->debugfs_phy, |