Skip to content

Commit

Permalink
net: marvell: 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 <hslester96@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Chuhong Yuan authored and David S. Miller committed Jul 24, 2019
1 parent f876a78 commit 7bdb923
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/marvell/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/ethernet/marvell/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7bdb923

Please sign in to comment.