net: ethernet: use platform_{get,set}_drvdata()

Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.

Also, unnecessary dev_set_drvdata() is removed, because the driver core
clears the driver data to NULL after device_release or on probe failure.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jingoo Han
2013-05-23 00:52:31 +00:00
committed by David S. Miller
parent 6d0bfe2261
commit 8513fbd880
23 changed files with 66 additions and 95 deletions

View File

@@ -1565,7 +1565,7 @@ error1:
static int greth_of_remove(struct platform_device *of_dev)
{
struct net_device *ndev = dev_get_drvdata(&of_dev->dev);
struct net_device *ndev = platform_get_drvdata(of_dev);
struct greth_private *greth = netdev_priv(ndev);
/* Free descriptor areas */
@@ -1573,8 +1573,6 @@ static int greth_of_remove(struct platform_device *of_dev)
dma_free_coherent(&of_dev->dev, 1024, greth->tx_bd_base, greth->tx_bd_base_phys);
dev_set_drvdata(&of_dev->dev, NULL);
if (greth->phy)
phy_stop(greth->phy);
mdiobus_unregister(greth->mdio);