aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ax25/sysctl_net_ax25.c27
1 files changed, 5 insertions, 22 deletions
diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c
index 443a83676638..f597987b2424 100644
--- a/net/ax25/sysctl_net_ax25.c
+++ b/net/ax25/sysctl_net_ax25.c
@@ -31,25 +31,11 @@ static struct ctl_table_header *ax25_table_header;
31static ctl_table *ax25_table; 31static ctl_table *ax25_table;
32static int ax25_table_size; 32static int ax25_table_size;
33 33
34static ctl_table ax25_dir_table[] = { 34static struct ctl_path ax25_path[] = {
35 { 35 { .procname = "net", .ctl_name = CTL_NET, },
36 .ctl_name = NET_AX25, 36 { .procname = "ax25", .ctl_name = NET_AX25, },
37 .procname = "ax25", 37 { }
38 .mode = 0555,
39 },
40 { .ctl_name = 0 }
41};
42
43static ctl_table ax25_root_table[] = {
44 {
45 .ctl_name = CTL_NET,
46 .procname = "net",
47 .mode = 0555,
48 .child = ax25_dir_table
49 },
50 { .ctl_name = 0 }
51}; 38};
52
53static const ctl_table ax25_param_table[] = { 39static const ctl_table ax25_param_table[] = {
54 { 40 {
55 .ctl_name = NET_AX25_IP_DEFAULT_MODE, 41 .ctl_name = NET_AX25_IP_DEFAULT_MODE,
@@ -243,9 +229,7 @@ void ax25_register_sysctl(void)
243 } 229 }
244 spin_unlock_bh(&ax25_dev_lock); 230 spin_unlock_bh(&ax25_dev_lock);
245 231
246 ax25_dir_table[0].child = ax25_table; 232 ax25_table_header = register_sysctl_paths(ax25_path, ax25_table);
247
248 ax25_table_header = register_sysctl_table(ax25_root_table);
249} 233}
250 234
251void ax25_unregister_sysctl(void) 235void ax25_unregister_sysctl(void)
@@ -253,7 +237,6 @@ void ax25_unregister_sysctl(void)
253 ctl_table *p; 237 ctl_table *p;
254 unregister_sysctl_table(ax25_table_header); 238 unregister_sysctl_table(ax25_table_header);
255 239
256 ax25_dir_table[0].child = NULL;
257 for (p = ax25_table; p->ctl_name; p++) 240 for (p = ax25_table; p->ctl_name; p++)
258 kfree(p->child); 241 kfree(p->child);
259 kfree(ax25_table); 242 kfree(ax25_table);