mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
proc: introduce proc_create_single{,_data}
Variants of proc_create{,_data} that directly take a seq_file show callback and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
@@ -238,21 +238,9 @@ static int filesystems_proc_show(struct seq_file *m, void *v)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int filesystems_proc_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
return single_open(file, filesystems_proc_show, NULL);
|
||||
}
|
||||
|
||||
static const struct file_operations filesystems_proc_fops = {
|
||||
.open = filesystems_proc_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
static int __init proc_filesystems_init(void)
|
||||
{
|
||||
proc_create("filesystems", 0, NULL, &filesystems_proc_fops);
|
||||
proc_create_single("filesystems", 0, NULL, filesystems_proc_show);
|
||||
return 0;
|
||||
}
|
||||
module_init(proc_filesystems_init);
|
||||
|
Reference in New Issue
Block a user