diff options
author | David S. Miller <davem@davemloft.net> | 2018-04-24 23:59:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-24 23:59:11 -0400 |
commit | c749fa181bd5848be78691d23168ec61ce691b95 (patch) | |
tree | d037dc016bd880d9d5b393a30f3907ef5e98124d /drivers/net/team | |
parent | 16f4faa4f06ff3b4e214922d55ac33ab6e2bdbdc (diff) | |
parent | 3be4aaf4e2d3eb95cce7835e8df797ae65ae5ac1 (diff) | |
download | linux-c749fa181bd5848be78691d23168ec61ce691b95.tar.bz2 |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/net/team')
-rw-r--r-- | drivers/net/team/team.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 5c77fa445d2d..9dbd390ace34 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @@ -1072,14 +1072,11 @@ static void team_port_leave(struct team *team, struct team_port *port) } #ifdef CONFIG_NET_POLL_CONTROLLER -static int team_port_enable_netpoll(struct team *team, struct team_port *port) +static int __team_port_enable_netpoll(struct team_port *port) { struct netpoll *np; int err; - if (!team->dev->npinfo) - return 0; - np = kzalloc(sizeof(*np), GFP_KERNEL); if (!np) return -ENOMEM; @@ -1093,6 +1090,14 @@ static int team_port_enable_netpoll(struct team *team, struct team_port *port) return err; } +static int team_port_enable_netpoll(struct team_port *port) +{ + if (!port->team->dev->npinfo) + return 0; + + return __team_port_enable_netpoll(port); +} + static void team_port_disable_netpoll(struct team_port *port) { struct netpoll *np = port->np; @@ -1107,7 +1112,7 @@ static void team_port_disable_netpoll(struct team_port *port) kfree(np); } #else -static int team_port_enable_netpoll(struct team *team, struct team_port *port) +static int team_port_enable_netpoll(struct team_port *port) { return 0; } @@ -1221,7 +1226,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev, goto err_vids_add; } - err = team_port_enable_netpoll(team, port); + err = team_port_enable_netpoll(port); if (err) { netdev_err(dev, "Failed to enable netpoll on device %s\n", portname); @@ -1918,7 +1923,7 @@ static int team_netpoll_setup(struct net_device *dev, mutex_lock(&team->lock); list_for_each_entry(port, &team->port_list, list) { - err = team_port_enable_netpoll(team, port); + err = __team_port_enable_netpoll(port); if (err) { __team_netpoll_cleanup(team); break; |