Commit a763d83a authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji

[NET]: Use proc_net_fops_create() and proc_net_remove() in net/core.

parent 72af4165
...@@ -1994,26 +1994,21 @@ extern int wireless_proc_init(void); ...@@ -1994,26 +1994,21 @@ extern int wireless_proc_init(void);
static int __init dev_proc_init(void) static int __init dev_proc_init(void)
{ {
struct proc_dir_entry *p;
int rc = -ENOMEM; int rc = -ENOMEM;
p = create_proc_entry("dev", S_IRUGO, proc_net); if (!proc_net_fops_create("dev", S_IRUGO, &dev_seq_fops))
if (!p)
goto out; goto out;
p->proc_fops = &dev_seq_fops; if (!proc_net_fops_create("softnet_stat", S_IRUGO, &softnet_seq_fops))
p = create_proc_entry("softnet_stat", S_IRUGO, proc_net);
if (!p)
goto out_dev; goto out_dev;
p->proc_fops = &softnet_seq_fops;
if (wireless_proc_init()) if (wireless_proc_init())
goto out_softnet; goto out_softnet;
rc = 0; rc = 0;
out: out:
return rc; return rc;
out_softnet: out_softnet:
remove_proc_entry("softnet_stat", proc_net); proc_net_remove("softnet_stat");
out_dev: out_dev:
remove_proc_entry("dev", proc_net); proc_net_remove("dev");
goto out; goto out;
} }
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment