Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268772
b: refs/heads/master
c: f247be5
h: refs/heads/master
v: v3
  • Loading branch information
Mark Einon authored and Greg Kroah-Hartman committed Oct 11, 2011
1 parent 0d437eb commit a1a98fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a75fc17aaa52d4fa7a6bc619a094e542beafac3e
refs/heads/master: f247be5d6b5bf5378a9cfec2e315b1ae913f8f0d
20 changes: 12 additions & 8 deletions trunk/drivers/staging/et131x/et131x_initpci.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,26 +870,27 @@ static void __devexit et131x_pci_remove(struct pci_dev *pdev)
pci_disable_device(pdev);
}

static int et131x_pci_suspend(struct pci_dev *pdev, pm_message_t state)
#ifdef CONFIG_PM_SLEEP
static int et131x_suspend(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct net_device *netdev = pci_get_drvdata(pdev);

if (netif_running(netdev)) {
netif_device_detach(netdev);
et131x_down(netdev);
pci_save_state(pdev);
pci_set_power_state(pdev, pci_choose_state(pdev, state));
}

return 0;
}

static int et131x_pci_resume(struct pci_dev *pdev)
static int et131x_resume(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct net_device *netdev = pci_get_drvdata(pdev);

if (netif_running(netdev)) {
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);
et131x_up(netdev);
netif_device_attach(netdev);
Expand All @@ -898,6 +899,12 @@ static int et131x_pci_resume(struct pci_dev *pdev)
return 0;
}

static SIMPLE_DEV_PM_OPS(et131x_pm_ops, et131x_suspend, et131x_resume);
#define ET131X_PM_OPS (&et131x_pm_ops)
#else
#define ET131X_PM_OPS NULL
#endif

static struct pci_device_id et131x_pci_table[] __devinitdata = {
{ET131X_PCI_VENDOR_ID, ET131X_PCI_DEVICE_ID_GIG, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, 0UL},
Expand All @@ -913,10 +920,7 @@ static struct pci_driver et131x_driver = {
.id_table = et131x_pci_table,
.probe = et131x_pci_setup,
.remove = __devexit_p(et131x_pci_remove),
#ifdef CONFIG_PM
.suspend = et131x_pci_suspend,
.resume = et131x_pci_resume,
#endif
.driver.pm = ET131X_PM_OPS,
};

/**
Expand Down

0 comments on commit a1a98fe

Please sign in to comment.