net: marvell: Use dev_get_drvdata where possible
authorChuhong Yuan <hslester96@gmail.com>
Wed, 24 Jul 2019 11:26:34 +0000 (19:26 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Jul 2019 18:44:46 +0000 (11:44 -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/marvell/skge.c
drivers/net/ethernet/marvell/sky2.c

index 9ac854c2b3718507d90738cb0de4018339040763..06dffee81e02b4b321f63ee2ea67bbd6cb660dbf 100644 (file)
@@ -4078,8 +4078,7 @@ static void skge_remove(struct pci_dev *pdev)
 #ifdef CONFIG_PM_SLEEP
 static int skge_suspend(struct device *dev)
 {
-       struct pci_dev *pdev = to_pci_dev(dev);
-       struct skge_hw *hw  = pci_get_drvdata(pdev);
+       struct skge_hw *hw  = dev_get_drvdata(dev);
        int i;
 
        if (!hw)
@@ -4103,8 +4102,7 @@ static int skge_suspend(struct device *dev)
 
 static int skge_resume(struct device *dev)
 {
-       struct pci_dev *pdev = to_pci_dev(dev);
-       struct skge_hw *hw  = pci_get_drvdata(pdev);
+       struct skge_hw *hw  = dev_get_drvdata(dev);
        int i, err;
 
        if (!hw)
index f518312ffe695470bf1dd4239d9e2b1b08e5ea54..762fe0821923841c3226d0ad5e399bcdb9e30138 100644 (file)
@@ -5160,8 +5160,7 @@ static void sky2_remove(struct pci_dev *pdev)
 
 static int sky2_suspend(struct device *dev)
 {
-       struct pci_dev *pdev = to_pci_dev(dev);
-       struct sky2_hw *hw = pci_get_drvdata(pdev);
+       struct sky2_hw *hw = dev_get_drvdata(dev);
        int i;
 
        if (!hw)