Commit 0fb52a27 authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

team: cleanup netpoll clode

This started out with fixing a sparse warning, then I realized that
the wrapper function team_netpoll_info could just be collapsed away
by rolling it into the enable code.
Signed-off-by: default avatarStephen Hemminger <stephen@networkplumber.org>
Acked-by: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 93d8bf9f
......@@ -1037,6 +1037,9 @@ static int team_port_enable_netpoll(struct team *team, struct team_port *port,
struct netpoll *np;
int err;
if (!team->dev->npinfo)
return 0;
np = kzalloc(sizeof(*np), gfp);
if (!np)
return -ENOMEM;
......@@ -1063,12 +1066,6 @@ static void team_port_disable_netpoll(struct team_port *port)
__netpoll_cleanup(np);
kfree(np);
}
static struct netpoll_info *team_netpoll_info(struct team *team)
{
return team->dev->npinfo;
}
#else
static int team_port_enable_netpoll(struct team *team, struct team_port *port,
gfp_t gfp)
......@@ -1078,10 +1075,6 @@ static int team_port_enable_netpoll(struct team *team, struct team_port *port,
static void team_port_disable_netpoll(struct team_port *port)
{
}
static struct netpoll_info *team_netpoll_info(struct team *team)
{
return NULL;
}
#endif
static void __team_port_change_port_added(struct team_port *port, bool linkup);
......@@ -1163,14 +1156,12 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
goto err_vids_add;
}
if (team_netpoll_info(team)) {
err = team_port_enable_netpoll(team, port, GFP_KERNEL);
if (err) {
netdev_err(dev, "Failed to enable netpoll on device %s\n",
portname);
goto err_enable_netpoll;
}
}
err = netdev_master_upper_dev_link(port_dev, dev);
if (err) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment