diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2018-10-21 22:00:17 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-22 06:10:12 +0200 |
commit | 4e13c252276d3aa56f028cada2bd7cb41694d03f (patch) | |
tree | f599b21e9bc2a45cb72d09c60e1e3fde39989221 /drivers/net/ethernet/ti/cpsw.c | |
parent | net: ethernet: smsc: smc91x: simplify getting .driver_data (diff) | |
download | linux-4e13c252276d3aa56f028cada2bd7cb41694d03f.tar.xz linux-4e13c252276d3aa56f028cada2bd7cb41694d03f.zip |
net: ethernet: ti: cpsw: simplify getting .driver_data
We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ti/cpsw.c')
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 226be2a56c1f..6cf4d4cb152e 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -3669,8 +3669,7 @@ static int cpsw_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int cpsw_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); struct cpsw_common *cpsw = ndev_to_cpsw(ndev); if (cpsw->data.dual_emac) { @@ -3693,8 +3692,7 @@ static int cpsw_suspend(struct device *dev) static int cpsw_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); struct cpsw_common *cpsw = ndev_to_cpsw(ndev); /* Select default pin state */ |