summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mic/scif
diff options
context:
space:
mode:
authorYangtao Li <tiny.windzz@gmail.com>2018-12-01 12:05:30 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-06 15:42:18 +0100
commit2796b43feeeaf2d74998e42d1fddcefed6955f54 (patch)
treeb57cae66202a7b4506c2c1881046a56c92b3180c /drivers/misc/mic/scif
parentddfa728ad1b1dbb4172ba65f3043d2d50c694f3d (diff)
downloadlinux-2796b43feeeaf2d74998e42d1fddcefed6955f54.tar.gz
linux-2796b43feeeaf2d74998e42d1fddcefed6955f54.tar.bz2
linux-2796b43feeeaf2d74998e42d1fddcefed6955f54.zip
misc: remove GENWQE_DEBUGFS_RO()
We already have the DEFINE_SHOW_ATTRIBUTE.There is no need to define such a macro,so remove GENWQE_DEBUGFS_RO.Also use DEFINE_SHOW_ATTRIBUTE to simplify some code. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mic/scif')
-rw-r--r--drivers/misc/mic/scif/scif_debugfs.c44
1 files changed, 6 insertions, 38 deletions
diff --git a/drivers/misc/mic/scif/scif_debugfs.c b/drivers/misc/mic/scif/scif_debugfs.c
index 6884dad97e17..cca5e980c710 100644
--- a/drivers/misc/mic/scif/scif_debugfs.c
+++ b/drivers/misc/mic/scif/scif_debugfs.c
@@ -24,7 +24,7 @@
/* Debugfs parent dir */
static struct dentry *scif_dbg;
-static int scif_dev_test(struct seq_file *s, void *unused)
+static int scif_dev_show(struct seq_file *s, void *unused)
{
int node;
@@ -44,23 +44,7 @@ static int scif_dev_test(struct seq_file *s, void *unused)
return 0;
}
-static int scif_dev_test_open(struct inode *inode, struct file *file)
-{
- return single_open(file, scif_dev_test, inode->i_private);
-}
-
-static int scif_dev_test_release(struct inode *inode, struct file *file)
-{
- return single_release(inode, file);
-}
-
-static const struct file_operations scif_dev_ops = {
- .owner = THIS_MODULE,
- .open = scif_dev_test_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = scif_dev_test_release
-};
+DEFINE_SHOW_ATTRIBUTE(scif_dev);
static void scif_display_window(struct scif_window *window, struct seq_file *s)
{
@@ -104,7 +88,7 @@ static void scif_display_all_windows(struct list_head *head, struct seq_file *s)
}
}
-static int scif_rma_test(struct seq_file *s, void *unused)
+static int scif_rma_show(struct seq_file *s, void *unused)
{
struct scif_endpt *ep;
struct list_head *pos;
@@ -123,23 +107,7 @@ static int scif_rma_test(struct seq_file *s, void *unused)
return 0;
}
-static int scif_rma_test_open(struct inode *inode, struct file *file)
-{
- return single_open(file, scif_rma_test, inode->i_private);
-}
-
-static int scif_rma_test_release(struct inode *inode, struct file *file)
-{
- return single_release(inode, file);
-}
-
-static const struct file_operations scif_rma_ops = {
- .owner = THIS_MODULE,
- .open = scif_rma_test_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = scif_rma_test_release
-};
+DEFINE_SHOW_ATTRIBUTE(scif_rma);
void __init scif_init_debugfs(void)
{
@@ -150,8 +118,8 @@ void __init scif_init_debugfs(void)
return;
}
- debugfs_create_file("scif_dev", 0444, scif_dbg, NULL, &scif_dev_ops);
- debugfs_create_file("scif_rma", 0444, scif_dbg, NULL, &scif_rma_ops);
+ debugfs_create_file("scif_dev", 0444, scif_dbg, NULL, &scif_dev_fops);
+ debugfs_create_file("scif_rma", 0444, scif_dbg, NULL, &scif_rma_fops);
debugfs_create_u8("en_msg_log", 0666, scif_dbg, &scif_info.en_msg_log);
debugfs_create_u8("p2p_enable", 0666, scif_dbg, &scif_info.p2p_enable);
}