net: marvell: Use dev_get_drvdata where possible
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>
This commit is contained in:
parent
f876a78429
commit
7bdb923495
@ -4078,8 +4078,7 @@ static void skge_remove(struct pci_dev *pdev)
|
|||||||
#ifdef CONFIG_PM_SLEEP
|
#ifdef CONFIG_PM_SLEEP
|
||||||
static int skge_suspend(struct device *dev)
|
static int skge_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct pci_dev *pdev = to_pci_dev(dev);
|
struct skge_hw *hw = dev_get_drvdata(dev);
|
||||||
struct skge_hw *hw = pci_get_drvdata(pdev);
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!hw)
|
if (!hw)
|
||||||
@ -4103,8 +4102,7 @@ static int skge_suspend(struct device *dev)
|
|||||||
|
|
||||||
static int skge_resume(struct device *dev)
|
static int skge_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct pci_dev *pdev = to_pci_dev(dev);
|
struct skge_hw *hw = dev_get_drvdata(dev);
|
||||||
struct skge_hw *hw = pci_get_drvdata(pdev);
|
|
||||||
int i, err;
|
int i, err;
|
||||||
|
|
||||||
if (!hw)
|
if (!hw)
|
||||||
|
@ -5160,8 +5160,7 @@ static void sky2_remove(struct pci_dev *pdev)
|
|||||||
|
|
||||||
static int sky2_suspend(struct device *dev)
|
static int sky2_suspend(struct device *dev)
|
||||||
{
|
{
|
||||||
struct pci_dev *pdev = to_pci_dev(dev);
|
struct sky2_hw *hw = dev_get_drvdata(dev);
|
||||||
struct sky2_hw *hw = pci_get_drvdata(pdev);
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!hw)
|
if (!hw)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user