aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/netpoll.c
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2012-07-17 01:22:35 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-17 12:02:36 -0400
commit30fdd8a082a00126a6feec994e43e8dc12f5bccb (patch)
tree0b5f9589942f88bb25408e77f251334e0471c36c /net/core/netpoll.c
parent0c24604b68fc7810d429d6c3657b6f148270e528 (diff)
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>
Diffstat (limited to 'net/core/netpoll.c')
-rw-r--r--net/core/netpoll.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index f9f40b932e4b..b4c90e42b443 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -715,14 +715,16 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
715} 715}
716EXPORT_SYMBOL(netpoll_parse_options); 716EXPORT_SYMBOL(netpoll_parse_options);
717 717
718int __netpoll_setup(struct netpoll *np) 718int __netpoll_setup(struct netpoll *np, struct net_device *ndev)
719{ 719{
720 struct net_device *ndev = np->dev;
721 struct netpoll_info *npinfo; 720 struct netpoll_info *npinfo;
722 const struct net_device_ops *ops; 721 const struct net_device_ops *ops;
723 unsigned long flags; 722 unsigned long flags;
724 int err; 723 int err;
725 724
725 np->dev = ndev;
726 strlcpy(np->dev_name, ndev->name, IFNAMSIZ);
727
726 if ((ndev->priv_flags & IFF_DISABLE_NETPOLL) || 728 if ((ndev->priv_flags & IFF_DISABLE_NETPOLL) ||
727 !ndev->netdev_ops->ndo_poll_controller) { 729 !ndev->netdev_ops->ndo_poll_controller) {
728 np_err(np, "%s doesn't support polling, aborting\n", 730 np_err(np, "%s doesn't support polling, aborting\n",
@@ -851,13 +853,11 @@ int netpoll_setup(struct netpoll *np)
851 np_info(np, "local IP %pI4\n", &np->local_ip); 853 np_info(np, "local IP %pI4\n", &np->local_ip);
852 } 854 }
853 855
854 np->dev = ndev;
855
856 /* fill up the skb queue */ 856 /* fill up the skb queue */
857 refill_skbs(); 857 refill_skbs();
858 858
859 rtnl_lock(); 859 rtnl_lock();
860 err = __netpoll_setup(np); 860 err = __netpoll_setup(np, ndev);
861 rtnl_unlock(); 861 rtnl_unlock();
862 862
863 if (err) 863 if (err)