From: Pavel Belous <pavel.bel...@aquantia.com>

netdev_register should be called when everything is initialized.

Signed-off-by: Pavel Belous <pavel.bel...@aquantia.com>
---
 drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c 
b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
index e50fba2..daed4c1 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c
@@ -260,16 +260,18 @@ int aq_nic_ndev_register(struct aq_nic_s *self)
                ether_addr_copy(self->ndev->dev_addr, mac_addr_permanent);
        }
 #endif
-       err = register_netdev(self->ndev);
-       if (err < 0)
-               goto err_exit;
 
-       self->is_ndev_registered = true;
        netif_carrier_off(self->ndev);
 
        for (i = AQ_CFG_VECS_MAX; i--;)
                aq_nic_ndev_queue_stop(self, i);
 
+       err = register_netdev(self->ndev);
+       if (err < 0)
+               goto err_exit;
+
+       self->is_ndev_registered = true;
+
 err_exit:
        return err;
 }
-- 
2.7.4

Reply via email to