diff options
author | Chuhong Yuan | 2019-07-23 22:16:42 +0800 |
---|---|---|
committer | David S. Miller | 2019-07-23 13:02:42 -0700 |
commit | c9b6c56d52bea8adbf10ae0b9e4a7b88017c6f27 (patch) | |
tree | 740afb77d10e766c7bcb52b55a23c9e2c84a71b0 | |
parent | 5daab287c67d8008a01e4a0db8bcb92b386b8adc (diff) |
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>
-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)) |