net/faraday: Stop NCSI device on shutdown
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Tue, 4 Oct 2016 00:25:54 +0000 (11:25 +1100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Oct 2016 06:11:51 +0000 (02:11 -0400)
This stops NCSI device when closing the network device so that the
NCSI device can be reenabled later.

Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/faraday/ftgmac100.c

index 90f9c5481290e0d3cbf797f9d31f8b3edcc6b519..262587240c86e561a95fd142708ce031524f04ab 100644 (file)
@@ -1190,6 +1190,8 @@ static int ftgmac100_stop(struct net_device *netdev)
        napi_disable(&priv->napi);
        if (netdev->phydev)
                phy_stop(netdev->phydev);
+       else if (priv->use_ncsi)
+               ncsi_stop_dev(priv->ndev);
 
        ftgmac100_stop_hw(priv);
        free_irq(priv->irq, netdev);