From 3f3942aca6da351a12543aa776467791b63b3a78 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 15 May 2018 15:57:23 +0200 Subject: 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 --- drivers/net/wireless/ray_cs.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'drivers/net/wireless/ray_cs.c') diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c index 7f9b16b97ea3..a7e0a17aa7e8 100644 --- a/drivers/net/wireless/ray_cs.c +++ b/drivers/net/wireless/ray_cs.c @@ -2663,19 +2663,6 @@ static int ray_cs_proc_show(struct seq_file *m, void *v) } return 0; } - -static int ray_cs_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, ray_cs_proc_show, NULL); -} - -static const struct file_operations ray_cs_proc_fops = { - .owner = THIS_MODULE, - .open = ray_cs_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; #endif /*===========================================================================*/ static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type) @@ -2814,7 +2801,7 @@ static int __init init_ray_cs(void) #ifdef CONFIG_PROC_FS proc_mkdir("driver/ray_cs", NULL); - proc_create("driver/ray_cs/ray_cs", 0, NULL, &ray_cs_proc_fops); + proc_create_single("driver/ray_cs/ray_cs", 0, NULL, ray_cs_proc_show); proc_create("driver/ray_cs/essid", 0200, NULL, &ray_cs_essid_proc_fops); proc_create_data("driver/ray_cs/net_type", 0200, NULL, &int_proc_fops, &net_type); -- cgit