diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-30 05:07:56 (GMT) |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-04-09 18:13:09 (GMT) |
commit | 895b5599ba20cb663af9281050dc83cd7ae91843 (patch) | |
tree | 5253fe929e824b1dde3b56319ba325e949cf6d22 /drivers/staging/dgrp/dgrp_specproc.c | |
parent | af064cdde64d58feb315dba268e1f8439fb935be (diff) | |
download | linux-fsl-qoriq-895b5599ba20cb663af9281050dc83cd7ae91843.tar.xz |
dgrp procfs fixes, part 6: just use proc_create{,_data}
->permission() of its own is a rudiment of sysctl imitation;
normal procfs logics will do just fine here, no need to
mess with ->proc_iops at all.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/staging/dgrp/dgrp_specproc.c')
-rw-r--r-- | drivers/staging/dgrp/dgrp_specproc.c | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/drivers/staging/dgrp/dgrp_specproc.c b/drivers/staging/dgrp/dgrp_specproc.c index 22c5d0b..99c993b 100644 --- a/drivers/staging/dgrp/dgrp_specproc.c +++ b/drivers/staging/dgrp/dgrp_specproc.c @@ -55,12 +55,6 @@ static struct proc_dir_entry *add_proc_file(struct nd_struct *node, /* File operation declarations */ static int parse_write_config(char *); - -static struct inode_operations proc_inode_ops = { - .permission = dgrp_inode_permission -}; - - static ssize_t dgrp_config_proc_write(struct file *file, const char __user *buffer, size_t count, loff_t *pos); @@ -139,28 +133,15 @@ void dgrp_unregister_proc(void) void dgrp_register_proc(void) { - struct proc_dir_entry *de; /* * Register /proc/dgrp */ dgrp_proc_dir_entry = proc_mkdir("dgrp", NULL); if (!dgrp_proc_dir_entry) return; - de = create_proc_entry("dgrp/config", 0644, NULL); - if (de) { - de->proc_fops = &config_proc_file_ops; - de->proc_iops = &proc_inode_ops; - } - de = create_proc_entry("dgrp/info", 0644, NULL); - if (de) { - de->proc_fops = &info_proc_file_ops; - de->proc_iops = &proc_inode_ops; - } - de = create_proc_entry("dgrp/nodeinfo", 0644, NULL); - if (de) { - de->proc_fops = &nodeinfo_proc_file_ops; - de->proc_iops = &proc_inode_ops; - } + proc_create("dgrp/config", 0644, NULL, &config_proc_file_ops); + proc_create("dgrp/info", 0644, NULL, &info_proc_file_ops); + proc_create("dgrp/nodeinfo", 0644, NULL, &nodeinfo_proc_file_ops); net_entry_pointer = proc_mkdir_mode("dgrp/net", 0500, NULL); mon_entry_pointer = proc_mkdir_mode("dgrp/mon", 0500, NULL); dpa_entry_pointer = proc_mkdir_mode("dgrp/dpa", 0500, NULL); @@ -554,15 +535,6 @@ static struct proc_dir_entry *add_proc_file(struct nd_struct *node, const struct file_operations *fops) { char buf[3]; - struct proc_dir_entry *de; - ID_TO_CHAR(node->nd_ID, buf); - - de = create_proc_entry(buf, 0600 | S_IFREG, root); - if (de) { - de->data = (void *) node; - de->proc_fops = fops; - de->proc_iops = &proc_inode_ops; - } - return de; + return proc_create_data(buf, 0600, root, fops, node); } |