Skip to content

Commit

Permalink
e1000e: Use dev_get_drvdata where possible
Browse files Browse the repository at this point in the history
Instead of using to_pci_dev + pci_get_drvdata,
use dev_get_drvdata to make code simpler.

Signed-off-by: Chuhong Yuan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
WillLester authored and davem330 committed Jul 23, 2019
1 parent f521eaa commit ee2e80c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/net/ethernet/intel/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -6296,7 +6296,7 @@ static void e1000e_flush_lpic(struct pci_dev *pdev)

static int e1000e_pm_freeze(struct device *dev)
{
struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev));
struct net_device *netdev = dev_get_drvdata(dev);
struct e1000_adapter *adapter = netdev_priv(netdev);

netif_device_detach(netdev);
Expand Down Expand Up @@ -6629,7 +6629,7 @@ static int __e1000_resume(struct pci_dev *pdev)
#ifdef CONFIG_PM_SLEEP
static int e1000e_pm_thaw(struct device *dev)
{
struct net_device *netdev = pci_get_drvdata(to_pci_dev(dev));
struct net_device *netdev = dev_get_drvdata(dev);
struct e1000_adapter *adapter = netdev_priv(netdev);

e1000e_set_interrupt_capability(adapter);
Expand Down Expand Up @@ -6678,8 +6678,7 @@ static int e1000e_pm_resume(struct device *dev)

static int e1000e_pm_runtime_idle(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 e1000_adapter *adapter = netdev_priv(netdev);
u16 eee_lp;

Expand Down

0 comments on commit ee2e80c

Please sign in to comment.