aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio/cxgb4vf
diff options
context:
space:
mode:
authorYangtao Li <tiny.windzz@gmail.com>2018-12-15 02:59:30 -0500
committerDavid S. Miller <davem@davemloft.net>2018-12-15 11:21:22 -0800
commitb09026c6913eeef1b21914a9d441ba275df40f27 (patch)
tree72569b0cc68654d7710e7a4e3f8885e3edad74df /drivers/net/ethernet/chelsio/cxgb4vf
parentipconfig: convert to DEFINE_SHOW_ATTRIBUTE (diff)
downloadlinux-dev-b09026c6913eeef1b21914a9d441ba275df40f27.tar.xz
linux-dev-b09026c6913eeef1b21914a9d441ba275df40f27.zip
cxgb4: remove DEFINE_SIMPLE_DEBUGFS_FILE()
We already have the DEFINE_SHOW_ATTRIBUTE. There is no need to define such a macro, so remove DEFINE_SIMPLE_DEBUGFS_FILE. Also use the DEFINE_SHOW_ATTRIBUTE macro to simplify some code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4vf')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index 8a2ad6b387ea..2fab87e86561 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -2323,19 +2323,7 @@ static int resources_show(struct seq_file *seq, void *v)
return 0;
}
-
-static int resources_open(struct inode *inode, struct file *file)
-{
- return single_open(file, resources_show, inode->i_private);
-}
-
-static const struct file_operations resources_proc_fops = {
- .owner = THIS_MODULE,
- .open = resources_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(resources);
/*
* Show Virtual Interfaces.
@@ -2419,7 +2407,7 @@ static struct cxgb4vf_debugfs_entry debugfs_files[] = {
{ "mboxlog", 0444, &mboxlog_fops },
{ "sge_qinfo", 0444, &sge_qinfo_debugfs_fops },
{ "sge_qstats", 0444, &sge_qstats_proc_fops },
- { "resources", 0444, &resources_proc_fops },
+ { "resources", 0444, &resources_fops },
{ "interfaces", 0444, &interfaces_proc_fops },
};