OSDN Git Service

staging: vc04_services: convert to DEFINE_SHOW_ATTRIBUTE
authorYangtao Li <tiny.windzz@gmail.com>
Sat, 15 Dec 2018 09:01:13 +0000 (04:01 -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/vc04_services/interface/vchiq_arm/vchiq_debugfs.c

index 6a9e71a..46ba219 100644 (file)
@@ -153,19 +153,7 @@ static int debugfs_usecount_show(struct seq_file *f, void *offset)
 
        return 0;
 }
-
-static int debugfs_usecount_open(struct inode *inode, struct file *file)
-{
-       return single_open(file, debugfs_usecount_show, inode->i_private);
-}
-
-static const struct file_operations debugfs_usecount_fops = {
-       .owner          = THIS_MODULE,
-       .open           = debugfs_usecount_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(debugfs_usecount);
 
 static int debugfs_trace_show(struct seq_file *f, void *offset)
 {