Commit b8dbecff authored by Benjamin Herrenschmidt's avatar Benjamin Herrenschmidt Committed by David S. Miller

ftgmac100: Move napi_add/del to open/close

Rather than probe/remove
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 87d18757
...@@ -1160,6 +1160,9 @@ static int ftgmac100_open(struct net_device *netdev) ...@@ -1160,6 +1160,9 @@ static int ftgmac100_open(struct net_device *netdev)
if (err) if (err)
goto err_hw; goto err_hw;
/* Initialize NAPI */
netif_napi_add(netdev, &priv->napi, ftgmac100_poll, 64);
ftgmac100_init_hw(priv); ftgmac100_init_hw(priv);
ftgmac100_start_hw(priv); ftgmac100_start_hw(priv);
...@@ -1190,6 +1193,7 @@ static int ftgmac100_open(struct net_device *netdev) ...@@ -1190,6 +1193,7 @@ static int ftgmac100_open(struct net_device *netdev)
err_ncsi: err_ncsi:
napi_disable(&priv->napi); napi_disable(&priv->napi);
netif_stop_queue(netdev); netif_stop_queue(netdev);
netif_napi_del(&priv->napi);
iowrite32(0, priv->base + FTGMAC100_OFFSET_IER); iowrite32(0, priv->base + FTGMAC100_OFFSET_IER);
err_hw: err_hw:
free_irq(netdev->irq, netdev); free_irq(netdev->irq, netdev);
...@@ -1209,6 +1213,7 @@ static int ftgmac100_stop(struct net_device *netdev) ...@@ -1209,6 +1213,7 @@ static int ftgmac100_stop(struct net_device *netdev)
netif_stop_queue(netdev); netif_stop_queue(netdev);
napi_disable(&priv->napi); napi_disable(&priv->napi);
netif_napi_del(&priv->napi);
if (netdev->phydev) if (netdev->phydev)
phy_stop(netdev->phydev); phy_stop(netdev->phydev);
else if (priv->use_ncsi) else if (priv->use_ncsi)
...@@ -1381,9 +1386,6 @@ static int ftgmac100_probe(struct platform_device *pdev) ...@@ -1381,9 +1386,6 @@ static int ftgmac100_probe(struct platform_device *pdev)
spin_lock_init(&priv->tx_lock); spin_lock_init(&priv->tx_lock);
/* initialize NAPI */
netif_napi_add(netdev, &priv->napi, ftgmac100_poll, 64);
/* map io memory */ /* map io memory */
priv->res = request_mem_region(res->start, resource_size(res), priv->res = request_mem_region(res->start, resource_size(res),
dev_name(&pdev->dev)); dev_name(&pdev->dev));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment