summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/grcan.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-05-23 19:47:58 +0900
committerMarc Kleine-Budde <mkl@pengutronix.de>2013-06-03 13:13:49 +0200
commit00e4bbc8cd7efac66caa4ce6bcf5f02e944184f6 (patch)
tree57aac83b859b47d0bc4fb444b9b5a39800754b04 /drivers/net/can/grcan.c
parent4c4726faed6cf0c7545ac6523de4cc66acd0a61d (diff)
downloadlinux-00e4bbc8cd7efac66caa4ce6bcf5f02e944184f6.tar.bz2
net: can: 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: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/grcan.c')
-rw-r--r--drivers/net/can/grcan.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c
index 9e9d0d628e7b..6aa737a24393 100644
--- a/drivers/net/can/grcan.c
+++ b/drivers/net/can/grcan.c
@@ -1646,7 +1646,7 @@ static int grcan_setup_netdev(struct platform_device *ofdev,
if (err)
goto exit_free_candev;
- dev_set_drvdata(&ofdev->dev, dev);
+ platform_set_drvdata(ofdev, dev);
/* Reset device to allow bit-timing to be set. No need to call
* grcan_reset at this stage. That is done in grcan_open.
@@ -1715,13 +1715,12 @@ exit_error:
static int grcan_remove(struct platform_device *ofdev)
{
- struct net_device *dev = dev_get_drvdata(&ofdev->dev);
+ struct net_device *dev = platform_get_drvdata(ofdev);
struct grcan_priv *priv = netdev_priv(dev);
unregister_candev(dev); /* Will in turn call grcan_close */
irq_dispose_mapping(dev->irq);
- dev_set_drvdata(&ofdev->dev, NULL);
netif_napi_del(&priv->napi);
free_candev(dev);