be2net: Set mac addr in hw regardless of netif_running()
authorSathya Perla <sathyap@serverengines.com>
Mon, 17 Aug 2009 00:58:04 +0000 (00:58 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Aug 2009 00:48:27 +0000 (17:48 -0700)
be_mac_addr_set() currently is broken when netif_running() is false.

Signed-off-by: Sathya Perla <sathyap@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/benet/be_main.c

index 45507d88e6a135d2106e3e2101038011f4e8dea9..362346045ed3071bb65fda18c4bd3596e1dcbe40 100644 (file)
@@ -117,23 +117,18 @@ void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm, u16 num_popped)
        iowrite32(val, adapter->db + DB_CQ_OFFSET);
 }
 
-
 static int be_mac_addr_set(struct net_device *netdev, void *p)
 {
        struct be_adapter *adapter = netdev_priv(netdev);
        struct sockaddr *addr = p;
        int status = 0;
 
-       if (netif_running(netdev)) {
-               status = be_cmd_pmac_del(adapter, adapter->if_handle,
-                               adapter->pmac_id);
-               if (status)
-                       return status;
-
-               status = be_cmd_pmac_add(adapter, (u8 *)addr->sa_data,
-                               adapter->if_handle, &adapter->pmac_id);
-       }
+       status = be_cmd_pmac_del(adapter, adapter->if_handle, adapter->pmac_id);
+       if (status)
+               return status;
 
+       status = be_cmd_pmac_add(adapter, (u8 *)addr->sa_data,
+                       adapter->if_handle, &adapter->pmac_id);
        if (!status)
                memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);