diff mbox

[1/6,net-next] cnic: Simplify netdev events handling.

Message ID 1375063440-4016-1-git-send-email-mchan@broadcom.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Michael Chan July 29, 2013, 2:03 a.m. UTC
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 <mchan@broadcom.com>
---
 drivers/net/ethernet/broadcom/cnic.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

David Miller July 30, 2013, 5:04 a.m. UTC | #1
From: "Michael Chan" <mchan@broadcom.com>
Date: Sun, 28 Jul 2013 19:03:55 -0700

> 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 <mchan@broadcom.com>

Please, in the future, give me an introductory "[PATCH 0/6 ..." posting,
for two reasons:

1) So that you can give me a top-level description of the changes that
   are happening.

2) To provide me with a single email I can reply to when I decide that
   the entire series is OK.

I applied this entire series, thanks.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index d78d4cf..764bfc1 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;