summaryrefslogtreecommitdiff
path: root/drivers/misc/mic/vop/vop_debugfs.c
diff options
context:
space:
mode:
authorYangtao Li <tiny.windzz@gmail.com>2018-12-01 20:05:30 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-12-06 17:42:18 +0300
commit2796b43feeeaf2d74998e42d1fddcefed6955f54 (patch)
treeb57cae66202a7b4506c2c1881046a56c92b3180c /drivers/misc/mic/vop/vop_debugfs.c
parentddfa728ad1b1dbb4172ba65f3043d2d50c694f3d (diff)
downloadlinux-2796b43feeeaf2d74998e42d1fddcefed6955f54.tar.xz
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/vop/vop_debugfs.c')
-rw-r--r--drivers/misc/mic/vop/vop_debugfs.c40
1 files changed, 4 insertions, 36 deletions
diff --git a/drivers/misc/mic/vop/vop_debugfs.c b/drivers/misc/mic/vop/vop_debugfs.c
index ab43884e5cd7..2ccef52aca23 100644
--- a/drivers/misc/mic/vop/vop_debugfs.c
+++ b/drivers/misc/mic/vop/vop_debugfs.c
@@ -101,23 +101,7 @@ static int vop_dp_show(struct seq_file *s, void *pos)
return 0;
}
-static int vop_dp_debug_open(struct inode *inode, struct file *file)
-{
- return single_open(file, vop_dp_show, inode->i_private);
-}
-
-static int vop_dp_debug_release(struct inode *inode, struct file *file)
-{
- return single_release(inode, file);
-}
-
-static const struct file_operations dp_ops = {
- .owner = THIS_MODULE,
- .open = vop_dp_debug_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = vop_dp_debug_release
-};
+DEFINE_SHOW_ATTRIBUTE(vop_dp);
static int vop_vdev_info_show(struct seq_file *s, void *unused)
{
@@ -194,23 +178,7 @@ static int vop_vdev_info_show(struct seq_file *s, void *unused)
return 0;
}
-static int vop_vdev_info_debug_open(struct inode *inode, struct file *file)
-{
- return single_open(file, vop_vdev_info_show, inode->i_private);
-}
-
-static int vop_vdev_info_debug_release(struct inode *inode, struct file *file)
-{
- return single_release(inode, file);
-}
-
-static const struct file_operations vdev_info_ops = {
- .owner = THIS_MODULE,
- .open = vop_vdev_info_debug_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = vop_vdev_info_debug_release
-};
+DEFINE_SHOW_ATTRIBUTE(vop_vdev_info);
void vop_init_debugfs(struct vop_info *vi)
{
@@ -222,8 +190,8 @@ void vop_init_debugfs(struct vop_info *vi)
pr_err("can't create debugfs dir vop\n");
return;
}
- debugfs_create_file("dp", 0444, vi->dbg, vi, &dp_ops);
- debugfs_create_file("vdev_info", 0444, vi->dbg, vi, &vdev_info_ops);
+ debugfs_create_file("dp", 0444, vi->dbg, vi, &vop_dp_fops);
+ debugfs_create_file("vdev_info", 0444, vi->dbg, vi, &vop_vdev_info_fops);
}
void vop_exit_debugfs(struct vop_info *vi)