提交 1a63e846 编写于 作者: B Brice Goglin 提交者: Jeff Garzik

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: NBrice Goglin <brice@myri.com>
Signed-off-by: NStephen Hemminger <shemminger@osdl.org>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 83f6e152
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册