net: ethernet: ti: remove unnecessary platform_set_drvdata()
Subsystems (3)
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.
Signed-off-by Jingoo Han <[email protected]>
--- 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
@@ -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
@@ -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
Quoted 6 lines · Jingoo Han
The driver core clears the driver data to NULL after
device_releaseor on probe failure, since commit0998d0631001288a5974afc0b2a5f568bcdecb4d(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<[email protected]>
Acked-by Mugunthan V N <[email protected]>
Regards
Mugunthan V N