fm10k: Use dev_get_drvdata
authorChuhong Yuan <hslester96@gmail.com>
Tue, 23 Jul 2019 14:15:33 +0000 (22:15 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 23 Jul 2019 20:02:41 +0000 (13:02 -0700)
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>
drivers/net/ethernet/intel/fm10k/fm10k_pci.c

index e49fb51d36133ff49c6b11646f895b1b7dc8ee61..7bfc8a5b6f55caf5d441055159536597d46275d7 100644 (file)
@@ -2352,7 +2352,7 @@ static int fm10k_handle_resume(struct fm10k_intfc *interface)
  **/
 static int __maybe_unused fm10k_resume(struct device *dev)
 {
-       struct fm10k_intfc *interface = pci_get_drvdata(to_pci_dev(dev));
+       struct fm10k_intfc *interface = dev_get_drvdata(dev);
        struct net_device *netdev = interface->netdev;
        struct fm10k_hw *hw = &interface->hw;
        int err;
@@ -2379,7 +2379,7 @@ static int __maybe_unused fm10k_resume(struct device *dev)
  **/
 static int __maybe_unused fm10k_suspend(struct device *dev)
 {
-       struct fm10k_intfc *interface = pci_get_drvdata(to_pci_dev(dev));
+       struct fm10k_intfc *interface = dev_get_drvdata(dev);
        struct net_device *netdev = interface->netdev;
 
        netif_device_detach(netdev);