Commit 415fb87d authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

cnic: Simplify netdev events handling.

After this earlier commit to simplify probing:

    commit 4bd9b0ff
    cnic, bnx2x, bnx2: Simplify cnic probing.

we can now reliably receive netdev events and we can simplify the handling
of these events.  We now remove the logic that tries to handle missed
NETDEV_REGISTER events.

This change will allow cleanup to be simplified in the next patch.  We can
now rely on the play back of netdev events during
unregister_netdevice_notifier() to cleanup the structures.
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fe6f700d
...@@ -5628,7 +5628,7 @@ static int cnic_netdev_event(struct notifier_block *this, unsigned long event, ...@@ -5628,7 +5628,7 @@ static int cnic_netdev_event(struct notifier_block *this, unsigned long event,
dev = cnic_from_netdev(netdev); dev = cnic_from_netdev(netdev);
if (!dev && (event == NETDEV_REGISTER || netif_running(netdev))) { if (!dev && event == NETDEV_REGISTER) {
/* Check for the hot-plug device */ /* Check for the hot-plug device */
dev = is_cnic_dev(netdev); dev = is_cnic_dev(netdev);
if (dev) { if (dev) {
...@@ -5644,7 +5644,7 @@ static int cnic_netdev_event(struct notifier_block *this, unsigned long event, ...@@ -5644,7 +5644,7 @@ static int cnic_netdev_event(struct notifier_block *this, unsigned long event,
else if (event == NETDEV_UNREGISTER) else if (event == NETDEV_UNREGISTER)
cnic_ulp_exit(dev); cnic_ulp_exit(dev);
if (event == NETDEV_UP || (new_dev && netif_running(netdev))) { if (event == NETDEV_UP) {
if (cnic_register_netdev(dev) != 0) { if (cnic_register_netdev(dev) != 0) {
cnic_put(dev); cnic_put(dev);
goto done; goto done;
......
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