aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/misc.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-04-13 19:44:18 +0200
committerChristoph Hellwig <hch@lst.de>2018-05-16 07:23:35 +0200
commitfddda2b7b521185f3aa018f9559eb33b0aee53a9 (patch)
treeece18b3d82822f8eaefd8b0afa2f93307e83b253 /drivers/char/misc.c
parentproc: add a proc_create_reg helper (diff)
downloadlinux-dev-fddda2b7b521185f3aa018f9559eb33b0aee53a9.tar.xz
linux-dev-fddda2b7b521185f3aa018f9559eb33b0aee53a9.zip
proc: introduce proc_create_seq{,_data}
Variants of proc_create{,_data} that directly take a struct seq_operations argument and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/char/misc.c')
-rw-r--r--drivers/char/misc.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index 1bb9e7cc82e3..53cfe574d8d4 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -95,19 +95,6 @@ static const struct seq_operations misc_seq_ops = {
.stop = misc_seq_stop,
.show = misc_seq_show,
};
-
-static int misc_seq_open(struct inode *inode, struct file *file)
-{
- return seq_open(file, &misc_seq_ops);
-}
-
-static const struct file_operations misc_proc_fops = {
- .owner = THIS_MODULE,
- .open = misc_seq_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = seq_release,
-};
#endif
static int misc_open(struct inode *inode, struct file *file)
@@ -282,7 +269,7 @@ static int __init misc_init(void)
int err;
struct proc_dir_entry *ret;
- ret = proc_create("misc", 0, NULL, &misc_proc_fops);
+ ret = proc_create_seq("misc", 0, NULL, &misc_seq_ops);
misc_class = class_create(THIS_MODULE, "misc");
err = PTR_ERR(misc_class);
if (IS_ERR(misc_class))