aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_if.c
diff options
context:
space:
mode:
authorstephen hemminger <shemminger@vyatta.com>2010-05-10 05:31:08 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-16 02:10:01 -0400
commitcfb478da70f2213520866c84cb0aea0d7c0e1148 (patch)
treebc1a1ea16bbb2be0481d3231a2fbe5611437da55 /net/bridge/br_if.c
parentc17b274dc2aa538b68c1f02b01a3c4e124b435ba (diff)
bridge: netpoll cleanup
Move code around so that the ifdef for NETPOLL_CONTROLLER don't have to show up in main code path. The control functions should be in helpers that are only compiled if needed. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_if.c')
-rw-r--r--net/bridge/br_if.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 537bdd60d9b9..45f3f8871149 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -154,14 +154,7 @@ static void del_nbp(struct net_bridge_port *p)
154 kobject_uevent(&p->kobj, KOBJ_REMOVE); 154 kobject_uevent(&p->kobj, KOBJ_REMOVE);
155 kobject_del(&p->kobj); 155 kobject_del(&p->kobj);
156 156
157#ifdef CONFIG_NET_POLL_CONTROLLER 157 br_netpoll_disable(br, dev);
158 if (br_devices_support_netpoll(br))
159 br->dev->priv_flags &= ~IFF_DISABLE_NETPOLL;
160 if (dev->netdev_ops->ndo_netpoll_cleanup)
161 dev->netdev_ops->ndo_netpoll_cleanup(dev);
162 else
163 dev->npinfo = NULL;
164#endif
165 call_rcu(&p->rcu, destroy_nbp_rcu); 158 call_rcu(&p->rcu, destroy_nbp_rcu);
166} 159}
167 160
@@ -455,19 +448,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
455 448
456 kobject_uevent(&p->kobj, KOBJ_ADD); 449 kobject_uevent(&p->kobj, KOBJ_ADD);
457 450
458#ifdef CONFIG_NET_POLL_CONTROLLER 451 br_netpoll_enable(br, dev);
459 if (br_devices_support_netpoll(br)) {
460 br->dev->priv_flags &= ~IFF_DISABLE_NETPOLL;
461 if (br->dev->npinfo)
462 dev->npinfo = br->dev->npinfo;
463 } else if (!(br->dev->priv_flags & IFF_DISABLE_NETPOLL)) {
464 br->dev->priv_flags |= IFF_DISABLE_NETPOLL;
465 printk(KERN_INFO "New device %s does not support netpoll\n",
466 dev->name);
467 printk(KERN_INFO "Disabling netpoll for %s\n",
468 br->dev->name);
469 }
470#endif
471 452
472 return 0; 453 return 0;
473err2: 454err2: