提交 502664ee 编写于 作者: M Michał Mirosław 提交者: David S. Miller

irda: Use genl_register_family_with_ops()

Use genl_register_family_with_ops() instead of a copy.
Signed-off-by: NMichał Mirosław <mirq-linux@rere.qmqm.pl>
Cc: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 a7b11d73
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册