diff options
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 22 |
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 | ||
6199 | void ata_pci_device_do_resume(struct pci_dev *pdev) | 6199 | int 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 | ||
6207 | int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg) | 6217 | int 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) | |||
6221 | int ata_pci_device_resume(struct pci_dev *pdev) | 6231 | int 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 | ||