diff options
author | Chuhong Yuan <hslester96@gmail.com> | 2019-07-23 16:18:56 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-23 23:02:41 +0300 |
commit | f54b0fc86ce69fd923153b19604afbea1455c1b4 (patch) | |
tree | 6e0c7368890ac4cdaf8d8b1c15559126cfe687e1 /drivers/net/ethernet/atheros/alx | |
parent | 9f293c9af856bc6b404759eedb9bc6ad8d9cf631 (diff) | |
download | linux-f54b0fc86ce69fd923153b19604afbea1455c1b4.tar.xz |
net: atheros: 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/atheros/alx')
-rw-r--r-- | drivers/net/ethernet/atheros/alx/main.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/atheros/alx/main.c b/drivers/net/ethernet/atheros/alx/main.c index a3ec738da336..d4bbcdfd691a 100644 --- a/drivers/net/ethernet/atheros/alx/main.c +++ b/drivers/net/ethernet/atheros/alx/main.c @@ -1877,8 +1877,7 @@ static void alx_remove(struct pci_dev *pdev) #ifdef CONFIG_PM_SLEEP static int alx_suspend(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct alx_priv *alx = pci_get_drvdata(pdev); + struct alx_priv *alx = dev_get_drvdata(dev); if (!netif_running(alx->dev)) return 0; @@ -1889,8 +1888,7 @@ static int alx_suspend(struct device *dev) static int alx_resume(struct device *dev) { - struct pci_dev *pdev = to_pci_dev(dev); - struct alx_priv *alx = pci_get_drvdata(pdev); + struct alx_priv *alx = dev_get_drvdata(dev); struct alx_hw *hw = &alx->hw; int err; |