mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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>
This commit is contained in:
parent
27a43a85bc
commit
53f9cd5c16
1 changed files with 2 additions and 13 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue