Skip to content

Commit

Permalink
net: ethernet: ti: cpsw: simplify getting .driver_data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wolfram Sang authored and David S. Miller committed Oct 22, 2018
1 parent 9dd8360 commit 4e13c25
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/ti/cpsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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 */
Expand Down

0 comments on commit 4e13c25

Please sign in to comment.