Skip to contentSkip to conversation

net: ethernet: ti: remove unnecessary platform_set_drvdata()

PATCH Applied Jingoo Han 2 participants 2 messages May 7, 2013

Subsystems (3)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 28/36 net: ethernet: ti: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/net/ethernet/ti/cpsw.c         |    1 -
 drivers/net/ethernet/ti/davinci_emac.c |    2 --
 2 files changed, 0 insertions(+), 3 deletions(-)
drivers/net/ethernet/ti/cpsw.c +0 -1
index 21a5b29..89a4c40 100644
@@ -1940,7 +1940,6 @@ static int cpsw_remove(struct platform_device *pdev)
 	struct cpsw_priv *priv = netdev_priv(ndev);
 	int i;
 
-	platform_set_drvdata(pdev, NULL);
 	if (priv->data.dual_emac)
 		unregister_netdev(cpsw_get_slave_ndev(priv, 1));
 	unregister_netdev(ndev);
drivers/net/ethernet/ti/davinci_emac.c +0 -2
index 860e15d..efb6f65 100644
@@ -2037,8 +2037,6 @@ static int davinci_emac_remove(struct platform_device *pdev)
 
 	dev_notice(&ndev->dev, "DaVinci EMAC: davinci_emac_remove()\n");
 
-	platform_set_drvdata(pdev, NULL);
-
 	if (priv->txchan)
 		cpdma_chan_destroy(priv->txchan);
 	if (priv->rxchan)
Signature · 1 line
1.7.2.5
Acked-by on v1 28/36
#1 lore raw
Quoted 6 lines · Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL.

Regards
Mugunthan V N