diff options
author | Patrick McHardy <kaber@trash.net> | 2008-01-21 03:25:15 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:08:30 -0500 |
commit | 69ab4b7d6db68396dbfa827daa8d6f30f9b546a8 (patch) | |
tree | 5c87d44dc524774f553f8214dad13194fef89958 /net/8021q/vlanproc.c | |
parent | 198a291ce3a9103f4738600e3cf5416b66e009d9 (diff) |
[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>
Diffstat (limited to 'net/8021q/vlanproc.c')
-rw-r--r-- | net/8021q/vlanproc.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index 5da02e29a2c6..971e6233801e 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c | |||
@@ -158,15 +158,18 @@ void vlan_proc_cleanup(void) | |||
158 | int __init vlan_proc_init(void) | 158 | int __init vlan_proc_init(void) |
159 | { | 159 | { |
160 | proc_vlan_dir = proc_mkdir(name_root, init_net.proc_net); | 160 | proc_vlan_dir = proc_mkdir(name_root, init_net.proc_net); |
161 | if (proc_vlan_dir) { | 161 | if (!proc_vlan_dir) |
162 | proc_vlan_conf = create_proc_entry(name_conf, | 162 | goto err; |
163 | S_IFREG|S_IRUSR|S_IWUSR, | 163 | |
164 | proc_vlan_dir); | 164 | proc_vlan_conf = create_proc_entry(name_conf, S_IFREG|S_IRUSR|S_IWUSR, |
165 | if (proc_vlan_conf) { | 165 | proc_vlan_dir); |
166 | proc_vlan_conf->proc_fops = &vlan_fops; | 166 | if (!proc_vlan_conf) |
167 | return 0; | 167 | goto err; |
168 | } | 168 | proc_vlan_conf->proc_fops = &vlan_fops; |
169 | } | 169 | return 0; |
170 | |||
171 | err: | ||
172 | pr_err("%s: can't create entry in proc filesystem!\n", __FUNCTION__); | ||
170 | vlan_proc_cleanup(); | 173 | vlan_proc_cleanup(); |
171 | return -ENOBUFS; | 174 | return -ENOBUFS; |
172 | } | 175 | } |