diff options
author | Chuhong Yuan <hslester96@gmail.com> | 2019-07-23 17:16:42 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-23 23:02:42 +0300 |
commit | c9b6c56d52bea8adbf10ae0b9e4a7b88017c6f27 (patch) | |
tree | 740afb77d10e766c7bcb52b55a23c9e2c84a71b0 /drivers/net/ethernet/jme.c | |
parent | 5daab287c67d8008a01e4a0db8bcb92b386b8adc (diff) | |
download | linux-c9b6c56d52bea8adbf10ae0b9e4a7b88017c6f27.tar.xz |
net: jme: 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/jme.c')
-rw-r--r-- | drivers/net/ethernet/jme.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c index ff6393fd64ac..9c3ab00643bd 100644 --- a/drivers/net/ethernet/jme.c +++ b/drivers/net/ethernet/jme.c @@ -3192,8 +3192,7 @@ jme_shutdown(struct pci_dev *pdev) static int jme_suspend(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct net_device *netdev = pci_get_drvdata(pdev); + struct net_device *netdev = dev_get_drvdata(dev); struct jme_adapter *jme = netdev_priv(netdev); if (!netif_running(netdev)) @@ -3235,8 +3234,7 @@ jme_suspend(struct device *dev) static int jme_resume(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct net_device *netdev = pci_get_drvdata(pdev); + struct net_device *netdev = dev_get_drvdata(dev); struct jme_adapter *jme = netdev_priv(netdev); if (!netif_running(netdev)) |