diff options
author | Christoph Hellwig <hch@lst.de> | 2018-05-15 16:57:23 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 08:23:35 +0300 |
commit | 3f3942aca6da351a12543aa776467791b63b3a78 (patch) | |
tree | 31030e086ea36920e07078ea2289b9b72c0b2939 /drivers/isdn/hardware | |
parent | 44414d82cfe0f68cb59d0a42f599ccd893ae0032 (diff) | |
download | linux-3f3942aca6da351a12543aa776467791b63b3a78.tar.xz |
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>
Diffstat (limited to 'drivers/isdn/hardware')
-rw-r--r-- | drivers/isdn/hardware/eicon/diva_didd.c | 17 | ||||
-rw-r--r-- | drivers/isdn/hardware/eicon/divasi.c | 17 |
2 files changed, 4 insertions, 30 deletions
diff --git a/drivers/isdn/hardware/eicon/diva_didd.c b/drivers/isdn/hardware/eicon/diva_didd.c index fab6ccfb00d5..60e79257dd5f 100644 --- a/drivers/isdn/hardware/eicon/diva_didd.c +++ b/drivers/isdn/hardware/eicon/diva_didd.c @@ -78,26 +78,13 @@ static int divadidd_proc_show(struct seq_file *m, void *v) return 0; } -static int divadidd_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, divadidd_proc_show, NULL); -} - -static const struct file_operations divadidd_proc_fops = { - .owner = THIS_MODULE, - .open = divadidd_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - static int __init create_proc(void) { proc_net_eicon = proc_mkdir("eicon", init_net.proc_net); if (proc_net_eicon) { - proc_didd = proc_create(DRIVERLNAME, S_IRUGO, proc_net_eicon, - &divadidd_proc_fops); + proc_didd = proc_create_single(DRIVERLNAME, S_IRUGO, + proc_net_eicon, divadidd_proc_show); return (1); } return (0); diff --git a/drivers/isdn/hardware/eicon/divasi.c b/drivers/isdn/hardware/eicon/divasi.c index 525518c945fe..e7081e0c0e35 100644 --- a/drivers/isdn/hardware/eicon/divasi.c +++ b/drivers/isdn/hardware/eicon/divasi.c @@ -101,23 +101,10 @@ static int um_idi_proc_show(struct seq_file *m, void *v) return 0; } -static int um_idi_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, um_idi_proc_show, NULL); -} - -static const struct file_operations um_idi_proc_fops = { - .owner = THIS_MODULE, - .open = um_idi_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - static int __init create_um_idi_proc(void) { - um_idi_proc_entry = proc_create(DRIVERLNAME, S_IRUGO, proc_net_eicon, - &um_idi_proc_fops); + um_idi_proc_entry = proc_create_single(DRIVERLNAME, S_IRUGO, + proc_net_eicon, um_idi_proc_show); if (!um_idi_proc_entry) return (0); return (1); |