summaryrefslogtreecommitdiffstats
path: root/net/atm
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-04-24 17:05:17 +0200
committerChristoph Hellwig <hch@lst.de>2018-05-16 07:23:35 +0200
commit44414d82cfe0f68cb59d0a42f599ccd893ae0032 (patch)
treef89c89cf2f7c919c22bcf3dac566c89eac6d2ff4 /net/atm
parentfddda2b7b521185f3aa018f9559eb33b0aee53a9 (diff)
downloadlinux-44414d82cfe0f68cb59d0a42f599ccd893ae0032.tar.bz2
proc: introduce proc_create_seq_private
Variant of proc_create_data that directly take a struct seq_operations argument + a private state size 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 'net/atm')
-rw-r--r--net/atm/lec.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 3138a869b5c0..5a95fcf6f9b6 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -990,18 +990,6 @@ static const struct seq_operations lec_seq_ops = {
.stop = lec_seq_stop,
.show = lec_seq_show,
};
-
-static int lec_seq_open(struct inode *inode, struct file *file)
-{
- return seq_open_private(file, &lec_seq_ops, sizeof(struct lec_state));
-}
-
-static const struct file_operations lec_seq_fops = {
- .open = lec_seq_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = seq_release_private,
-};
#endif
static int lane_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
@@ -1047,7 +1035,8 @@ static int __init lane_module_init(void)
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *p;
- p = proc_create("lec", 0444, atm_proc_root, &lec_seq_fops);
+ p = proc_create_seq_private("lec", 0444, atm_proc_root, &lec_seq_ops,
+ sizeof(struct lec_state), NULL);
if (!p) {
pr_err("Unable to initialize /proc/net/atm/lec\n");
return -ENOMEM;