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

@@ -430,11 +430,9 @@ exit:
static int netx_eth_drv_remove(struct platform_device *pdev)
{
struct net_device *ndev = dev_get_drvdata(&pdev->dev);
struct net_device *ndev = platform_get_drvdata(pdev);
struct netx_eth_priv *priv = netdev_priv(ndev);
platform_set_drvdata(pdev, NULL);
unregister_netdev(ndev);
xc_stop(priv->xc);
free_xc(priv->xc);