Skip to content

Commit

Permalink
irda: Use genl_register_family_with_ops()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michał Mirosław authored and David S. Miller committed May 21, 2009
1 parent a7b11d7 commit 502664e
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions net/irda/irnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 502664e

Please sign in to comment.