diff options
author | Chuhong Yuan <hslester96@gmail.com> | 2019-07-23 16:18:44 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-23 23:02:41 +0300 |
commit | 9f293c9af856bc6b404759eedb9bc6ad8d9cf631 (patch) | |
tree | 545603a712068768f9e05ee3778b40cc66cb65b1 /drivers/net/ethernet/3com | |
parent | c349c0a28326c98ca145b59e0f7ba69e4eef3b80 (diff) | |
download | linux-9f293c9af856bc6b404759eedb9bc6ad8d9cf631.tar.xz |
net: 3com: 3c59x: Use dev_get_drvdata
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/3com')
-rw-r--r-- | drivers/net/ethernet/3com/3c59x.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c index 7be91e896f2d..8785c2ff3825 100644 --- a/drivers/net/ethernet/3com/3c59x.c +++ b/drivers/net/ethernet/3com/3c59x.c @@ -847,8 +847,7 @@ static void poll_vortex(struct net_device *dev) static int vortex_suspend(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct net_device *ndev = pci_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); if (!ndev || !netif_running(ndev)) return 0; @@ -861,8 +860,7 @@ static int vortex_suspend(struct device *dev) static int vortex_resume(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct net_device *ndev = pci_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); int err; if (!ndev || !netif_running(ndev)) |