aboutsummaryrefslogtreecommitdiffstats
path: root/net/phonet/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/phonet/sysctl.c')
-rw-r--r--net/phonet/sysctl.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/net/phonet/sysctl.c b/net/phonet/sysctl.c
index cea1c7dbdae2..696348fd31a1 100644
--- a/net/phonet/sysctl.c
+++ b/net/phonet/sysctl.c
@@ -27,6 +27,10 @@
27#include <linux/errno.h> 27#include <linux/errno.h>
28#include <linux/init.h> 28#include <linux/init.h>
29 29
30#include <net/sock.h>
31#include <linux/phonet.h>
32#include <net/phonet/phonet.h>
33
30#define DYNAMIC_PORT_MIN 0x40 34#define DYNAMIC_PORT_MIN 0x40
31#define DYNAMIC_PORT_MAX 0x7f 35#define DYNAMIC_PORT_MAX 0x7f
32 36
@@ -46,7 +50,8 @@ static void set_local_port_range(int range[2])
46 50
47void phonet_get_local_port_range(int *min, int *max) 51void phonet_get_local_port_range(int *min, int *max)
48{ 52{
49 unsigned seq; 53 unsigned int seq;
54
50 do { 55 do {
51 seq = read_seqbegin(&local_port_range_lock); 56 seq = read_seqbegin(&local_port_range_lock);
52 if (min) 57 if (min)
@@ -93,19 +98,13 @@ static struct ctl_table phonet_table[] = {
93 { } 98 { }
94}; 99};
95 100
96static struct ctl_path phonet_ctl_path[] = {
97 { .procname = "net", },
98 { .procname = "phonet", },
99 { },
100};
101
102int __init phonet_sysctl_init(void) 101int __init phonet_sysctl_init(void)
103{ 102{
104 phonet_table_hrd = register_sysctl_paths(phonet_ctl_path, phonet_table); 103 phonet_table_hrd = register_net_sysctl(&init_net, "net/phonet", phonet_table);
105 return phonet_table_hrd == NULL ? -ENOMEM : 0; 104 return phonet_table_hrd == NULL ? -ENOMEM : 0;
106} 105}
107 106
108void phonet_sysctl_exit(void) 107void phonet_sysctl_exit(void)
109{ 108{
110 unregister_sysctl_table(phonet_table_hrd); 109 unregister_net_sysctl_table(phonet_table_hrd);
111} 110}