mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
net: ethernet: remove unnecessary platform_set_drvdata()
The driver core clears the driver data to NULL after device_release
or on probe failure, since commit 0998d06310
(device-core: Ensure drvdata = NULL when no driver is bound).
Thus, it is not needed to manually clear the device driver data to NULL.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Roland Stigge <stigge@antcom.de>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Tested-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
3acfeac351
commit
dfd93c977d
@@ -849,7 +849,6 @@ static int ne_drv_remove(struct platform_device *pdev)
|
||||
free_irq(dev->irq, dev);
|
||||
release_region(dev->base_addr, NE_IO_EXTENT);
|
||||
free_netdev(dev);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1719,7 +1719,6 @@ out_err_mii_probe:
|
||||
mdiobus_unregister(lp->mii_bus);
|
||||
mdiobus_free(lp->mii_bus);
|
||||
out_err_probe_mac:
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
free_netdev(ndev);
|
||||
|
||||
return rc;
|
||||
@@ -1732,8 +1731,6 @@ static int bfin_mac_remove(struct platform_device *pdev)
|
||||
|
||||
bfin_phc_release(lp);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
lp->mii_bus->priv = NULL;
|
||||
|
||||
unregister_netdev(ndev);
|
||||
@@ -1868,7 +1865,6 @@ static int bfin_mii_bus_remove(struct platform_device *pdev)
|
||||
struct bfin_mii_bus_platform_data *mii_bus_pd =
|
||||
dev_get_platdata(&pdev->dev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
mdiobus_unregister(miibus);
|
||||
kfree(miibus->irq);
|
||||
mdiobus_free(miibus);
|
||||
|
||||
@@ -1301,8 +1301,6 @@ static int au1000_remove(struct platform_device *pdev)
|
||||
int i;
|
||||
struct resource *base, *macen;
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
unregister_netdev(dev);
|
||||
mdiobus_unregister(aup->mii_bus);
|
||||
mdiobus_free(aup->mii_bus);
|
||||
|
||||
@@ -1847,7 +1847,6 @@ static int bcm_enet_remove(struct platform_device *pdev)
|
||||
clk_disable_unprepare(priv->mac_clk);
|
||||
clk_put(priv->mac_clk);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
free_netdev(dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -435,7 +435,6 @@ static int at91ether_remove(struct platform_device *pdev)
|
||||
unregister_netdev(dev);
|
||||
clk_disable(lp->pclk);
|
||||
free_netdev(dev);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1649,7 +1649,6 @@ err_out_put_pclk:
|
||||
err_out_free_dev:
|
||||
free_netdev(dev);
|
||||
err_out:
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -1675,7 +1674,6 @@ static int __exit macb_remove(struct platform_device *pdev)
|
||||
clk_disable_unprepare(bp->pclk);
|
||||
clk_put(bp->pclk);
|
||||
free_netdev(dev);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1790,7 +1790,6 @@ err_io:
|
||||
free_netdev(ndev);
|
||||
err_alloc:
|
||||
release_mem_region(res->start, resource_size(res));
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1813,7 +1812,6 @@ static int xgmac_remove(struct platform_device *pdev)
|
||||
free_irq(ndev->irq, ndev);
|
||||
free_irq(priv->pmt_irq, ndev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
unregister_netdev(ndev);
|
||||
netif_napi_del(&priv->napi);
|
||||
|
||||
|
||||
@@ -783,7 +783,6 @@ static int ep93xx_eth_remove(struct platform_device *pdev)
|
||||
dev = platform_get_drvdata(pdev);
|
||||
if (dev == NULL)
|
||||
return 0;
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
ep = netdev_priv(dev);
|
||||
|
||||
|
||||
@@ -1699,8 +1699,6 @@ dm9000_drv_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
unregister_netdev(ndev);
|
||||
dm9000_release_board(pdev, netdev_priv(ndev));
|
||||
free_netdev(ndev); /* free device structure */
|
||||
|
||||
@@ -1147,8 +1147,6 @@ static int ethoc_remove(struct platform_device *pdev)
|
||||
struct net_device *netdev = platform_get_drvdata(pdev);
|
||||
struct ethoc *priv = netdev_priv(netdev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
if (netdev) {
|
||||
netif_napi_del(&priv->napi);
|
||||
phy_disconnect(priv->phy);
|
||||
|
||||
@@ -1311,7 +1311,6 @@ err_ioremap:
|
||||
release_resource(priv->res);
|
||||
err_req_mem:
|
||||
netif_napi_del(&priv->napi);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
free_netdev(netdev);
|
||||
err_alloc_etherdev:
|
||||
return err;
|
||||
@@ -1335,7 +1334,6 @@ static int __exit ftgmac100_remove(struct platform_device *pdev)
|
||||
release_resource(priv->res);
|
||||
|
||||
netif_napi_del(&priv->napi);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
free_netdev(netdev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1149,7 +1149,6 @@ err_ioremap:
|
||||
release_resource(priv->res);
|
||||
err_req_mem:
|
||||
netif_napi_del(&priv->napi);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
free_netdev(netdev);
|
||||
err_alloc_etherdev:
|
||||
return err;
|
||||
@@ -1169,7 +1168,6 @@ static int __exit ftmac100_remove(struct platform_device *pdev)
|
||||
release_resource(priv->res);
|
||||
|
||||
netif_napi_del(&priv->napi);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
free_netdev(netdev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2024,8 +2024,6 @@ fec_drv_remove(struct platform_device *pdev)
|
||||
clk_disable_unprepare(fep->clk_ipg);
|
||||
free_netdev(ndev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1211,7 +1211,6 @@ static int korina_remove(struct platform_device *pdev)
|
||||
iounmap(lp->rx_dma_regs);
|
||||
iounmap(lp->tx_dma_regs);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
unregister_netdev(bif->dev);
|
||||
free_netdev(bif->dev);
|
||||
|
||||
|
||||
@@ -2813,8 +2813,6 @@ static int mv643xx_eth_remove(struct platform_device *pdev)
|
||||
|
||||
free_netdev(mp->dev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -2804,8 +2804,6 @@ static int mvneta_remove(struct platform_device *pdev)
|
||||
irq_dispose_mapping(dev->irq);
|
||||
free_netdev(dev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1602,7 +1602,6 @@ static int pxa168_eth_remove(struct platform_device *pdev)
|
||||
unregister_netdev(dev);
|
||||
cancel_work_sync(&pep->tx_timeout_task);
|
||||
free_netdev(dev);
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1600,7 +1600,6 @@ ks8695_drv_remove(struct platform_device *pdev)
|
||||
struct net_device *ndev = platform_get_drvdata(pdev);
|
||||
struct ks8695_priv *ksp = netdev_priv(ndev);
|
||||
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
netif_napi_del(&ksp->napi);
|
||||
|
||||
unregister_netdev(ndev);
|
||||
|
||||
@@ -1250,7 +1250,6 @@ static int ks8842_remove(struct platform_device *pdev)
|
||||
iounmap(adapter->hw_addr);
|
||||
free_netdev(netdev);
|
||||
release_mem_region(iomem->start, resource_size(iomem));
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1671,7 +1671,6 @@ static int ks8851_remove(struct platform_device *pdev)
|
||||
iounmap(ks->hw_addr);
|
||||
free_netdev(netdev);
|
||||
release_mem_region(iomem->start, resource_size(iomem));
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user