diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2009-05-21 06:34:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-21 19:50:22 -0400 |
commit | 502664eeaf880d364821521bbced7ae342f77f64 (patch) | |
tree | b576ea4ac28b8ae9debd38a7f17d48b677cb5a84 /net/irda/irnetlink.c | |
parent | a7b11d738282337488ae158c975d76271ad43a98 (diff) |
irda: Use genl_register_family_with_ops()
Use genl_register_family_with_ops() instead of a copy.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Cc: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda/irnetlink.c')
-rw-r--r-- | net/irda/irnetlink.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/net/irda/irnetlink.c b/net/irda/irnetlink.c index 82c6118d82c6..8dd7ed7e7c1f 100644 --- a/net/irda/irnetlink.c +++ b/net/irda/irnetlink.c | |||
@@ -148,21 +148,8 @@ static struct genl_ops irda_nl_ops[] = { | |||
148 | 148 | ||
149 | int irda_nl_register(void) | 149 | int 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 | ||
168 | void irda_nl_unregister(void) | 155 | void irda_nl_unregister(void) |