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:

committed by
David S. Miller

parent
6d0bfe2261
commit
8513fbd880
@@ -1437,7 +1437,7 @@ static int octeon_mgmt_probe(struct platform_device *pdev)
|
||||
|
||||
SET_NETDEV_DEV(netdev, &pdev->dev);
|
||||
|
||||
dev_set_drvdata(&pdev->dev, netdev);
|
||||
platform_set_drvdata(pdev, netdev);
|
||||
p = netdev_priv(netdev);
|
||||
netif_napi_add(netdev, &p->napi, octeon_mgmt_napi_poll,
|
||||
OCTEON_MGMT_NAPI_WEIGHT);
|
||||
@@ -1559,7 +1559,7 @@ err:
|
||||
|
||||
static int octeon_mgmt_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *netdev = dev_get_drvdata(&pdev->dev);
|
||||
struct net_device *netdev = platform_get_drvdata(pdev);
|
||||
|
||||
unregister_netdev(netdev);
|
||||
free_netdev(netdev);
|
||||
|
Reference in New Issue
Block a user