igb: Use dev_get_drvdata where possible

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>
This commit is contained in:
Chuhong Yuan 2019-07-23 22:16:24 +08:00 committed by David S. Miller
parent 1c8aa7b1f1
commit 5daab287c6

View File

@ -8880,8 +8880,7 @@ static int __maybe_unused igb_resume(struct device *dev)
static int __maybe_unused igb_runtime_idle(struct device *dev) static int __maybe_unused igb_runtime_idle(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev); struct net_device *netdev = dev_get_drvdata(dev);
struct net_device *netdev = pci_get_drvdata(pdev);
struct igb_adapter *adapter = netdev_priv(netdev); struct igb_adapter *adapter = netdev_priv(netdev);
if (!igb_has_link(adapter)) if (!igb_has_link(adapter))