From: Michael Chan Date: Mon, 29 Jul 2013 02:03:55 +0000 (-0700) Subject: cnic: Simplify netdev events handling. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=415fb87da80fa45a9cbe820cb2a86e70668688eb;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git cnic: Simplify netdev events handling. After this earlier commit to simplify probing: commit 4bd9b0fffb193d2e288f67f81821af32df8d4349 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: Michael Chan Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index d78d4cf140ed..764bfc158949 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c @@ -5628,7 +5628,7 @@ static int cnic_netdev_event(struct notifier_block *this, unsigned long event, dev = cnic_from_netdev(netdev); - if (!dev && (event == NETDEV_REGISTER || netif_running(netdev))) { + if (!dev && event == NETDEV_REGISTER) { /* Check for the hot-plug device */ dev = is_cnic_dev(netdev); if (dev) { @@ -5644,7 +5644,7 @@ static int cnic_netdev_event(struct notifier_block *this, unsigned long event, else if (event == NETDEV_UNREGISTER) cnic_ulp_exit(dev); - if (event == NETDEV_UP || (new_dev && netif_running(netdev))) { + if (event == NETDEV_UP) { if (cnic_register_netdev(dev) != 0) { cnic_put(dev); goto done;