aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda/irnetlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/irda/irnetlink.c')
-rw-r--r--net/irda/irnetlink.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/net/irda/irnetlink.c b/net/irda/irnetlink.c
index 2f05ec1037ab..476b307bd801 100644
--- a/net/irda/irnetlink.c
+++ b/net/irda/irnetlink.c
@@ -87,7 +87,7 @@ static int irda_nl_get_mode(struct sk_buff *skb, struct genl_info *info)
87 if (!dev) 87 if (!dev)
88 return -ENODEV; 88 return -ENODEV;
89 89
90 msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); 90 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
91 if (!msg) { 91 if (!msg) {
92 dev_put(dev); 92 dev_put(dev);
93 return -ENOMEM; 93 return -ENOMEM;
@@ -115,7 +115,7 @@ static int irda_nl_get_mode(struct sk_buff *skb, struct genl_info *info)
115 115
116 genlmsg_end(msg, hdr); 116 genlmsg_end(msg, hdr);
117 117
118 return genlmsg_unicast(msg, info->snd_pid); 118 return genlmsg_reply(msg, info);
119 119
120 err_out: 120 err_out:
121 nlmsg_free(msg); 121 nlmsg_free(msg);
@@ -148,21 +148,8 @@ static struct genl_ops irda_nl_ops[] = {
148 148
149int irda_nl_register(void) 149int irda_nl_register(void)
150{ 150{
151 int err, i; 151 return genl_register_family_with_ops(&irda_nl_family,
152 152 irda_nl_ops, ARRAY_SIZE(irda_nl_ops));
153 err = genl_register_family(&irda_nl_family);
154 if (err)
155 return err;
156
157 for (i = 0; i < ARRAY_SIZE(irda_nl_ops); i++) {
158 err = genl_register_ops(&irda_nl_family, &irda_nl_ops[i]);
159 if (err)
160 goto err_out;
161 }
162 return 0;
163 err_out:
164 genl_unregister_family(&irda_nl_family);
165 return err;
166} 153}
167 154
168void irda_nl_unregister(void) 155void irda_nl_unregister(void)