diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-05-23 00:52:31 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-25 21:27:58 -0700 |
commit | 8513fbd880093f00a47e85a552f14ca2de8d84d6 (patch) | |
tree | 6f061e2e9b87983cd91688bff5238c730db79137 /drivers/net/ethernet/freescale/gianfar.c | |
parent | 6d0bfe22611602f36617bc7aa2ffa1bbb2f54c67 (diff) | |
download | linux-stable-8513fbd880093f00a47e85a552f14ca2de8d84d6.tar.gz linux-stable-8513fbd880093f00a47e85a552f14ca2de8d84d6.tar.bz2 linux-stable-8513fbd880093f00a47e85a552f14ca2de8d84d6.zip |
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/freescale/gianfar.c')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index 2375a01715a0..14f06947e70d 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c @@ -1000,7 +1000,7 @@ static int gfar_probe(struct platform_device *ofdev) spin_lock_init(&priv->bflock); INIT_WORK(&priv->reset_task, gfar_reset_task); - dev_set_drvdata(&ofdev->dev, priv); + platform_set_drvdata(ofdev, priv); regs = priv->gfargrp[0].regs; gfar_detect_errata(priv); @@ -1240,15 +1240,13 @@ register_fail: static int gfar_remove(struct platform_device *ofdev) { - struct gfar_private *priv = dev_get_drvdata(&ofdev->dev); + struct gfar_private *priv = platform_get_drvdata(ofdev); if (priv->phy_node) of_node_put(priv->phy_node); if (priv->tbi_node) of_node_put(priv->tbi_node); - dev_set_drvdata(&ofdev->dev, NULL); - unregister_netdev(priv->ndev); unmap_group_regs(priv); free_gfar_dev(priv); |