netpoll: move np->dev and np->dev_name init into __netpoll_setup()

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jiri Pirko
2012-07-17 05:22:35 +00:00
committed by David S. Miller
parent 0c24604b68
commit 30fdd8a082
5 changed files with 9 additions and 17 deletions

View File

@@ -715,14 +715,16 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
}
EXPORT_SYMBOL(netpoll_parse_options);
int __netpoll_setup(struct netpoll *np)
int __netpoll_setup(struct netpoll *np, struct net_device *ndev)
{
struct net_device *ndev = np->dev;
struct netpoll_info *npinfo;
const struct net_device_ops *ops;
unsigned long flags;
int err;
np->dev = ndev;
strlcpy(np->dev_name, ndev->name, IFNAMSIZ);
if ((ndev->priv_flags & IFF_DISABLE_NETPOLL) ||
!ndev->netdev_ops->ndo_poll_controller) {
np_err(np, "%s doesn't support polling, aborting\n",
@@ -851,13 +853,11 @@ int netpoll_setup(struct netpoll *np)
np_info(np, "local IP %pI4\n", &np->local_ip);
}
np->dev = ndev;
/* fill up the skb queue */
refill_skbs();
rtnl_lock();
err = __netpoll_setup(np);
err = __netpoll_setup(np, ndev);
rtnl_unlock();
if (err)