summaryrefslogtreecommitdiffstats
path: root/net/atm/lec.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-04-24 11:05:17 -0400
committerChristoph Hellwig <hch@lst.de>2018-05-16 01:23:35 -0400
commit44414d82cfe0f68cb59d0a42f599ccd893ae0032 (patch)
treef89c89cf2f7c919c22bcf3dac566c89eac6d2ff4 /net/atm/lec.c
parentfddda2b7b521185f3aa018f9559eb33b0aee53a9 (diff)
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/lec.c')
-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 = {
990 .stop = lec_seq_stop, 990 .stop = lec_seq_stop,
991 .show = lec_seq_show, 991 .show = lec_seq_show,
992}; 992};
993
994static int lec_seq_open(struct inode *inode, struct file *file)
995{
996 return seq_open_private(file, &lec_seq_ops, sizeof(struct lec_state));
997}
998
999static const struct file_operations lec_seq_fops = {
1000 .open = lec_seq_open,
1001 .read = seq_read,
1002 .llseek = seq_lseek,
1003 .release = seq_release_private,
1004};
1005#endif 993#endif
1006 994
1007static int lane_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) 995static int lane_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
@@ -1047,7 +1035,8 @@ static int __init lane_module_init(void)
1047#ifdef CONFIG_PROC_FS 1035#ifdef CONFIG_PROC_FS
1048 struct proc_dir_entry *p; 1036 struct proc_dir_entry *p;
1049 1037
1050 p = proc_create("lec", 0444, atm_proc_root, &lec_seq_fops); 1038 p = proc_create_seq_private("lec", 0444, atm_proc_root, &lec_seq_ops,
1039 sizeof(struct lec_state), NULL);
1051 if (!p) { 1040 if (!p) {
1052 pr_err("Unable to initialize /proc/net/atm/lec\n"); 1041 pr_err("Unable to initialize /proc/net/atm/lec\n");
1053 return -ENOMEM; 1042 return -ENOMEM;