[VLAN]: Clean up initialization code

- move module init/exit functions to end of file, remove some now unnecessary
  forward declarations
- remove some obvious comments
- clean up proc init function and move a proc-related printk there

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Patrick McHardy
2008-01-21 00:25:15 -08:00
committed by David S. Miller
parent 198a291ce3
commit 69ab4b7d6d
2 changed files with 70 additions and 92 deletions

View File

@@ -158,15 +158,18 @@ void vlan_proc_cleanup(void)
int __init vlan_proc_init(void)
{
proc_vlan_dir = proc_mkdir(name_root, init_net.proc_net);
if (proc_vlan_dir) {
proc_vlan_conf = create_proc_entry(name_conf,
S_IFREG|S_IRUSR|S_IWUSR,
proc_vlan_dir);
if (proc_vlan_conf) {
proc_vlan_conf->proc_fops = &vlan_fops;
return 0;
}
}
if (!proc_vlan_dir)
goto err;
proc_vlan_conf = create_proc_entry(name_conf, S_IFREG|S_IRUSR|S_IWUSR,
proc_vlan_dir);
if (!proc_vlan_conf)
goto err;
proc_vlan_conf->proc_fops = &vlan_fops;
return 0;
err:
pr_err("%s: can't create entry in proc filesystem!\n", __FUNCTION__);
vlan_proc_cleanup();
return -ENOBUFS;
}