Commit 4e13c252 authored by Wolfram Sang's avatar Wolfram Sang Committed by David S. Miller

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9dd8360c
...@@ -3669,8 +3669,7 @@ static int cpsw_remove(struct platform_device *pdev) ...@@ -3669,8 +3669,7 @@ static int cpsw_remove(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int cpsw_suspend(struct device *dev) static int cpsw_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct net_device *ndev = dev_get_drvdata(dev);
struct net_device *ndev = platform_get_drvdata(pdev);
struct cpsw_common *cpsw = ndev_to_cpsw(ndev); struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
if (cpsw->data.dual_emac) { if (cpsw->data.dual_emac) {
...@@ -3693,8 +3692,7 @@ static int cpsw_suspend(struct device *dev) ...@@ -3693,8 +3692,7 @@ static int cpsw_suspend(struct device *dev)
static int cpsw_resume(struct device *dev) static int cpsw_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct net_device *ndev = dev_get_drvdata(dev);
struct net_device *ndev = platform_get_drvdata(pdev);
struct cpsw_common *cpsw = ndev_to_cpsw(ndev); struct cpsw_common *cpsw = ndev_to_cpsw(ndev);
/* Select default pin state */ /* Select default pin state */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment