irda: Use genl_register_family_with_ops()
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Thu, 21 May 2009 10:34:04 +0000 (10:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 May 2009 23:50:22 +0000 (16:50 -0700)
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>
net/irda/irnetlink.c

index 82c6118d82c6199ab064ed3be8f0e51193031ec3..8dd7ed7e7c1fa184d18a2eb711194e90a7495f76 100644 (file)
@@ -148,21 +148,8 @@ static struct genl_ops irda_nl_ops[] = {
 
 int irda_nl_register(void)
 {
-       int err, i;
-
-       err = genl_register_family(&irda_nl_family);
-       if (err)
-               return err;
-
-       for (i = 0; i < ARRAY_SIZE(irda_nl_ops); i++) {
-               err = genl_register_ops(&irda_nl_family, &irda_nl_ops[i]);
-               if (err)
-                       goto err_out;
-       }
-       return 0;
- err_out:
-       genl_unregister_family(&irda_nl_family);
-       return err;
+       return genl_register_family_with_ops(&irda_nl_family,
+               irda_nl_ops, ARRAY_SIZE(irda_nl_ops));
 }
 
 void irda_nl_unregister(void)