aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-12-26 05:39:50 -0500
committerJeff Garzik <jeff@garzik.org>2007-02-09 17:39:30 -0500
commit553c4aa630af7bc885e056d0436e4eb7f238579b (patch)
tree5a6cf3b15e05309fcfbdb5f68471e2a20b235613 /drivers/ata/libata-core.c
parent8bfa79fcb81d2bdb043f60ab4171704467808b55 (diff)
libata: handle pci_enable_device() failure while resuming
Handle pci_enable_device() failure while resuming. This patch kills the "ignoring return value of 'pci_enable_device'" warning message and propagates __must_check through ata_pci_device_do_resume(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index a03019c40ac4..89f3cf57b677 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -6196,12 +6196,22 @@ void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg)
6196 } 6196 }
6197} 6197}
6198 6198
6199void ata_pci_device_do_resume(struct pci_dev *pdev) 6199int ata_pci_device_do_resume(struct pci_dev *pdev)
6200{ 6200{
6201 int rc;
6202
6201 pci_set_power_state(pdev, PCI_D0); 6203 pci_set_power_state(pdev, PCI_D0);
6202 pci_restore_state(pdev); 6204 pci_restore_state(pdev);
6203 pci_enable_device(pdev); 6205
6206 rc = pci_enable_device(pdev);
6207 if (rc) {
6208 dev_printk(KERN_ERR, &pdev->dev,
6209 "failed to enable device after resume (%d)\n", rc);
6210 return rc;
6211 }
6212
6204 pci_set_master(pdev); 6213 pci_set_master(pdev);
6214 return 0;
6205} 6215}
6206 6216
6207int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) 6217int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
@@ -6221,10 +6231,12 @@ int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
6221int ata_pci_device_resume(struct pci_dev *pdev) 6231int ata_pci_device_resume(struct pci_dev *pdev)
6222{ 6232{
6223 struct ata_host *host = dev_get_drvdata(&pdev->dev); 6233 struct ata_host *host = dev_get_drvdata(&pdev->dev);
6234 int rc;
6224 6235
6225 ata_pci_device_do_resume(pdev); 6236 rc = ata_pci_device_do_resume(pdev);
6226 ata_host_resume(host); 6237 if (rc == 0)
6227 return 0; 6238 ata_host_resume(host);
6239 return rc;
6228} 6240}
6229#endif /* CONFIG_PCI */ 6241#endif /* CONFIG_PCI */
6230 6242