diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-05-22 20:52:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-26 00:27:58 -0400 |
commit | 8513fbd880093f00a47e85a552f14ca2de8d84d6 (patch) | |
tree | 6f061e2e9b87983cd91688bff5238c730db79137 /drivers/net/ethernet/aeroflex | |
parent | 6d0bfe22611602f36617bc7aa2ffa1bbb2f54c67 (diff) |
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>
Diffstat (limited to 'drivers/net/ethernet/aeroflex')
-rw-r--r-- | drivers/net/ethernet/aeroflex/greth.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c index 269295403fc4..7ff4b30d55ea 100644 --- a/drivers/net/ethernet/aeroflex/greth.c +++ b/drivers/net/ethernet/aeroflex/greth.c | |||
@@ -1565,7 +1565,7 @@ error1: | |||
1565 | 1565 | ||
1566 | static int greth_of_remove(struct platform_device *of_dev) | 1566 | static int greth_of_remove(struct platform_device *of_dev) |
1567 | { | 1567 | { |
1568 | struct net_device *ndev = dev_get_drvdata(&of_dev->dev); | 1568 | struct net_device *ndev = platform_get_drvdata(of_dev); |
1569 | struct greth_private *greth = netdev_priv(ndev); | 1569 | struct greth_private *greth = netdev_priv(ndev); |
1570 | 1570 | ||
1571 | /* Free descriptor areas */ | 1571 | /* Free descriptor areas */ |
@@ -1573,8 +1573,6 @@ static int greth_of_remove(struct platform_device *of_dev) | |||
1573 | 1573 | ||
1574 | dma_free_coherent(&of_dev->dev, 1024, greth->tx_bd_base, greth->tx_bd_base_phys); | 1574 | dma_free_coherent(&of_dev->dev, 1024, greth->tx_bd_base, greth->tx_bd_base_phys); |
1575 | 1575 | ||
1576 | dev_set_drvdata(&of_dev->dev, NULL); | ||
1577 | |||
1578 | if (greth->phy) | 1576 | if (greth->phy) |
1579 | phy_stop(greth->phy); | 1577 | phy_stop(greth->phy); |
1580 | mdiobus_unregister(greth->mdio); | 1578 | mdiobus_unregister(greth->mdio); |