diff options
Diffstat (limited to 'drivers/net/team/team.c')
-rw-r--r-- | drivers/net/team/team.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 6574eb8766f9..34b0de09d881 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -2650,7 +2650,7 @@ static int team_nl_cmd_port_list_get(struct sk_buff *skb, | |||
2650 | return err; | 2650 | return err; |
2651 | } | 2651 | } |
2652 | 2652 | ||
2653 | static struct genl_ops team_nl_ops[] = { | 2653 | static const struct genl_ops team_nl_ops[] = { |
2654 | { | 2654 | { |
2655 | .cmd = TEAM_CMD_NOOP, | 2655 | .cmd = TEAM_CMD_NOOP, |
2656 | .doit = team_nl_cmd_noop, | 2656 | .doit = team_nl_cmd_noop, |
@@ -2676,15 +2676,15 @@ static struct genl_ops team_nl_ops[] = { | |||
2676 | }, | 2676 | }, |
2677 | }; | 2677 | }; |
2678 | 2678 | ||
2679 | static struct genl_multicast_group team_change_event_mcgrp = { | 2679 | static const struct genl_multicast_group team_nl_mcgrps[] = { |
2680 | .name = TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME, | 2680 | { .name = TEAM_GENL_CHANGE_EVENT_MC_GRP_NAME, }, |
2681 | }; | 2681 | }; |
2682 | 2682 | ||
2683 | static int team_nl_send_multicast(struct sk_buff *skb, | 2683 | static int team_nl_send_multicast(struct sk_buff *skb, |
2684 | struct team *team, u32 portid) | 2684 | struct team *team, u32 portid) |
2685 | { | 2685 | { |
2686 | return genlmsg_multicast_netns(dev_net(team->dev), skb, 0, | 2686 | return genlmsg_multicast_netns(&team_nl_family, dev_net(team->dev), |
2687 | team_change_event_mcgrp.id, GFP_KERNEL); | 2687 | skb, 0, 0, GFP_KERNEL); |
2688 | } | 2688 | } |
2689 | 2689 | ||
2690 | static int team_nl_send_event_options_get(struct team *team, | 2690 | static int team_nl_send_event_options_get(struct team *team, |
@@ -2703,23 +2703,8 @@ static int team_nl_send_event_port_get(struct team *team, | |||
2703 | 2703 | ||
2704 | static int team_nl_init(void) | 2704 | static int team_nl_init(void) |
2705 | { | 2705 | { |
2706 | int err; | 2706 | return genl_register_family_with_ops_groups(&team_nl_family, team_nl_ops, |
2707 | 2707 | team_nl_mcgrps); | |
2708 | err = genl_register_family_with_ops(&team_nl_family, team_nl_ops, | ||
2709 | ARRAY_SIZE(team_nl_ops)); | ||
2710 | if (err) | ||
2711 | return err; | ||
2712 | |||
2713 | err = genl_register_mc_group(&team_nl_family, &team_change_event_mcgrp); | ||
2714 | if (err) | ||
2715 | goto err_change_event_grp_reg; | ||
2716 | |||
2717 | return 0; | ||
2718 | |||
2719 | err_change_event_grp_reg: | ||
2720 | genl_unregister_family(&team_nl_family); | ||
2721 | |||
2722 | return err; | ||
2723 | } | 2708 | } |
2724 | 2709 | ||
2725 | static void team_nl_fini(void) | 2710 | static void team_nl_fini(void) |