aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrice Goglin <brice@myri.com>2006-12-18 05:52:34 -0500
committerJeff Garzik <jeff@garzik.org>2006-12-26 16:28:20 -0500
commit1a63e846a4099e6fbff86a3b112064378515f254 (patch)
treeec50f988c639bcbf72652dbb787d9de9c4817a05
parent83f6e1524586119df84f70b7127688c57349664a (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>
-rw-r--r--drivers/net/myri10ge/myri10ge.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 9bc5dab949fd..07cf574197e5 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)
2540 myri10ge_dummy_rdma(mgp, 0); 2540 myri10ge_dummy_rdma(mgp, 0);
2541 pci_save_state(pdev); 2541 pci_save_state(pdev);
2542 pci_disable_device(pdev); 2542 pci_disable_device(pdev);
2543 pci_set_power_state(pdev, pci_choose_state(pdev, state)); 2543
2544 return 0; 2544 return pci_set_power_state(pdev, pci_choose_state(pdev, state));
2545} 2545}
2546 2546
2547static int myri10ge_resume(struct pci_dev *pdev) 2547static int myri10ge_resume(struct pci_dev *pdev)
@@ -2564,12 +2564,14 @@ static int myri10ge_resume(struct pci_dev *pdev)
2564 return -EIO; 2564 return -EIO;
2565 } 2565 }
2566 2566
2567 pci_restore_state(pdev); 2567 status = pci_restore_state(pdev);
2568 if (status)
2569 return status;
2568 2570
2569 status = pci_enable_device(pdev); 2571 status = pci_enable_device(pdev);
2570 if (status < 0) { 2572 if (status) {
2571 dev_err(&pdev->dev, "failed to enable device\n"); 2573 dev_err(&pdev->dev, "failed to enable device\n");
2572 return -EIO; 2574 return status;
2573 } 2575 }
2574 2576
2575 pci_set_master(pdev); 2577 pci_set_master(pdev);