net: eth: altera: Fix the initial device operstate
authorAtsushi Nemoto <nemoto@toshiba-tops.co.jp>
Tue, 8 Sep 2015 09:15:41 +0000 (18:15 +0900)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Sep 2015 19:10:15 +0000 (12:10 -0700)
Call netif_carrier_off() prior to register_netdev(), otherwise
userspace can see incorrect link state.

Signed-off-by: Atsushi Nemoto <nemoto@toshiba-tops.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/altera/altera_tse_main.c

index 8207877d623760d733401a621c4c3f37ecab6cd7..fe644823ceaf951139a55fdeeb910058ecad6cd1 100644 (file)
@@ -1517,6 +1517,7 @@ static int altera_tse_probe(struct platform_device *pdev)
        spin_lock_init(&priv->tx_lock);
        spin_lock_init(&priv->rxdma_irq_lock);
 
+       netif_carrier_off(ndev);
        ret = register_netdev(ndev);
        if (ret) {
                dev_err(&pdev->dev, "failed to register TSE net device\n");