diff options
author | Brice Goglin <brice@myri.com> | 2006-12-18 11:52:34 +0100 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-26 16:28:20 -0500 |
commit | 1a63e846a4099e6fbff86a3b112064378515f254 (patch) | |
tree | ec50f988c639bcbf72652dbb787d9de9c4817a05 /drivers/net | |
parent | 83f6e1524586119df84f70b7127688c57349664a (diff) |
myri10ge: handle failures in suspend and resume
On suspend, handle pci_set_power_state errors, and on resume
handle failures in pci_resume_state().
Signed-off-by: Brice Goglin <brice@myri.com>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 9bc5dab949f..07cf574197e 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c @@ -2540,8 +2540,8 @@ static int myri10ge_suspend(struct pci_dev *pdev, pm_message_t state) myri10ge_dummy_rdma(mgp, 0); pci_save_state(pdev); pci_disable_device(pdev); - pci_set_power_state(pdev, pci_choose_state(pdev, state)); - return 0; + + return pci_set_power_state(pdev, pci_choose_state(pdev, state)); } static int myri10ge_resume(struct pci_dev *pdev) @@ -2564,12 +2564,14 @@ static int myri10ge_resume(struct pci_dev *pdev) return -EIO; } - pci_restore_state(pdev); + status = pci_restore_state(pdev); + if (status) + return status; status = pci_enable_device(pdev); - if (status < 0) { + if (status) { dev_err(&pdev->dev, "failed to enable device\n"); - return -EIO; + return status; } pci_set_master(pdev); |