staging: unisys: convert to DEFINE_SHOW_ATTRIBUTE
authorYangtao Li <tiny.windzz@gmail.com>
Sat, 15 Dec 2018 08:59:12 +0000 (03:59 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Dec 2018 13:24:11 +0000 (14:24 +0100)
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorhba/visorhba_main.c

index 4fc521c51c0e8d639a54ff6d1c6799f97361f16d..d0fed63c13a29c67e005270652960baf15b907f4 100644 (file)
@@ -681,19 +681,7 @@ static int info_debugfs_show(struct seq_file *seq, void *v)
 
        return 0;
 }
-
-static int info_debugfs_open(struct inode *inode, struct file *file)
-{
-       return single_open(file, info_debugfs_show, inode->i_private);
-}
-
-static const struct file_operations info_debugfs_fops = {
-       .owner = THIS_MODULE,
-       .open = info_debugfs_open,
-       .read = seq_read,
-       .llseek = seq_lseek,
-       .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(info_debugfs);
 
 /*
  * complete_taskmgmt_command - Complete task management