aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/octeon/octeon_mgmt.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-05-22 20:52:31 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-26 00:27:58 -0400
commit8513fbd880093f00a47e85a552f14ca2de8d84d6 (patch)
tree6f061e2e9b87983cd91688bff5238c730db79137 /drivers/net/ethernet/octeon/octeon_mgmt.c
parent6d0bfe22611602f36617bc7aa2ffa1bbb2f54c67 (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/octeon/octeon_mgmt.c')
-rw-r--r--drivers/net/ethernet/octeon/octeon_mgmt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c
index 921729f9c85c..e6e029237a63 100644
--- a/drivers/net/ethernet/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
@@ -1437,7 +1437,7 @@ static int octeon_mgmt_probe(struct platform_device *pdev)
1437 1437
1438 SET_NETDEV_DEV(netdev, &pdev->dev); 1438 SET_NETDEV_DEV(netdev, &pdev->dev);
1439 1439
1440 dev_set_drvdata(&pdev->dev, netdev); 1440 platform_set_drvdata(pdev, netdev);
1441 p = netdev_priv(netdev); 1441 p = netdev_priv(netdev);
1442 netif_napi_add(netdev, &p->napi, octeon_mgmt_napi_poll, 1442 netif_napi_add(netdev, &p->napi, octeon_mgmt_napi_poll,
1443 OCTEON_MGMT_NAPI_WEIGHT); 1443 OCTEON_MGMT_NAPI_WEIGHT);
@@ -1559,7 +1559,7 @@ err:
1559 1559
1560static int octeon_mgmt_remove(struct platform_device *pdev) 1560static int octeon_mgmt_remove(struct platform_device *pdev)
1561{ 1561{
1562 struct net_device *netdev = dev_get_drvdata(&pdev->dev); 1562 struct net_device *netdev = platform_get_drvdata(pdev);
1563 1563
1564 unregister_netdev(netdev); 1564 unregister_netdev(netdev);
1565 free_netdev(netdev); 1565 free_netdev(netdev);