summaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorLiu Shixin <liushixin2@huawei.com>2022-09-13 18:10:38 +0800
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2022-09-19 16:40:39 +0200
commit53f9cd5c16a57076ba1ef01c62299fa899bd83b3 (patch)
tree2be35e2769b77a88265e1c0a03abe1990e0c544e /arch/mips
parent27a43a85bcfe5cd9ee0fa561d7ec9aead462166d (diff)
mips: ralink: convert to DEFINE_SHOW_ATTRIBUTE
Use DEFINE_SHOW_ATTRIBUTE helper macro to simplify the code. Signed-off-by: Liu Shixin <liushixin2@huawei.com> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/ralink/bootrom.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/arch/mips/ralink/bootrom.c b/arch/mips/ralink/bootrom.c
index 94ca8379b83c..8c8cc0a81ed8 100644
--- a/arch/mips/ralink/bootrom.c
+++ b/arch/mips/ralink/bootrom.c
@@ -18,22 +18,11 @@ static int bootrom_show(struct seq_file *s, void *unused)
return 0;
}
-
-static int bootrom_open(struct inode *inode, struct file *file)
-{
- return single_open(file, bootrom_show, NULL);
-}
-
-static const struct file_operations bootrom_file_ops = {
- .open = bootrom_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
-};
+DEFINE_SHOW_ATTRIBUTE(bootrom);
static int __init bootrom_setup(void)
{
- debugfs_create_file("bootrom", 0444, NULL, NULL, &bootrom_file_ops);
+ debugfs_create_file("bootrom", 0444, NULL, NULL, &bootrom_fops);
return 0;
}