diff options
Diffstat (limited to 'drivers/w1/w1_netlink.c')
-rw-r--r-- | drivers/w1/w1_netlink.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/w1/w1_netlink.c b/drivers/w1/w1_netlink.c index e7b774423dd6..328645da7972 100644 --- a/drivers/w1/w1_netlink.c +++ b/drivers/w1/w1_netlink.c | |||
@@ -57,10 +57,36 @@ void w1_netlink_send(struct w1_master *dev, struct w1_netlink_msg *msg) | |||
57 | nlmsg_failure: | 57 | nlmsg_failure: |
58 | return; | 58 | return; |
59 | } | 59 | } |
60 | |||
61 | int dev_init_netlink(struct w1_master *dev) | ||
62 | { | ||
63 | dev->nls = netlink_kernel_create(NETLINK_W1, 1, NULL, THIS_MODULE); | ||
64 | if (!dev->nls) { | ||
65 | printk(KERN_ERR "Failed to create new netlink socket(%u) for w1 master %s.\n", | ||
66 | NETLINK_W1, dev->dev.bus_id); | ||
67 | } | ||
68 | |||
69 | return 0; | ||
70 | } | ||
71 | |||
72 | void dev_fini_netlink(struct w1_master *dev) | ||
73 | { | ||
74 | if (dev->nls && dev->nls->sk_socket) | ||
75 | sock_release(dev->nls->sk_socket); | ||
76 | } | ||
60 | #else | 77 | #else |
61 | #warning Netlink support is disabled. Please compile with NET support enabled. | 78 | #warning Netlink support is disabled. Please compile with NET support enabled. |
62 | 79 | ||
63 | void w1_netlink_send(struct w1_master *dev, struct w1_netlink_msg *msg) | 80 | void w1_netlink_send(struct w1_master *dev, struct w1_netlink_msg *msg) |
64 | { | 81 | { |
65 | } | 82 | } |
83 | |||
84 | int dev_init_netlink(struct w1_master *dev) | ||
85 | { | ||
86 | return 0; | ||
87 | } | ||
88 | |||
89 | void dev_fini_netlink(struct w1_master *dev) | ||
90 | { | ||
91 | } | ||
66 | #endif | 92 | #endif |