Skip to content

Commit

Permalink
net: ethernet: smsc: smc91x: 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 3fcdaad commit 9dd8360
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/smsc/smc91x.c
Original file line number Diff line number Diff line change
@@ -2447,8 +2447,7 @@ static int smc_drv_remove(struct platform_device *pdev)

static int smc_drv_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);

if (ndev) {
if (netif_running(ndev)) {

0 comments on commit 9dd8360

Please sign in to comment.