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>
This commit is contained in:
parent
8bfa79fcb8
commit
553c4aa630
|
@ -1397,7 +1397,9 @@ static int ahci_pci_device_resume(struct pci_dev *pdev)
|
||||||
void __iomem *mmio = host->mmio_base;
|
void __iomem *mmio = host->mmio_base;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
ata_pci_device_do_resume(pdev);
|
rc = ata_pci_device_do_resume(pdev);
|
||||||
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) {
|
if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND) {
|
||||||
rc = ahci_reset_controller(mmio, pdev);
|
rc = ahci_reset_controller(mmio, pdev);
|
||||||
|
|
|
@ -6196,12 +6196,22 @@ void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ata_pci_device_do_resume(struct pci_dev *pdev)
|
int ata_pci_device_do_resume(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
|
int rc;
|
||||||
|
|
||||||
pci_set_power_state(pdev, PCI_D0);
|
pci_set_power_state(pdev, PCI_D0);
|
||||||
pci_restore_state(pdev);
|
pci_restore_state(pdev);
|
||||||
pci_enable_device(pdev);
|
|
||||||
|
rc = pci_enable_device(pdev);
|
||||||
|
if (rc) {
|
||||||
|
dev_printk(KERN_ERR, &pdev->dev,
|
||||||
|
"failed to enable device after resume (%d)\n", rc);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
pci_set_master(pdev);
|
pci_set_master(pdev);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
|
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)
|
||||||
int ata_pci_device_resume(struct pci_dev *pdev)
|
int ata_pci_device_resume(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
struct ata_host *host = dev_get_drvdata(&pdev->dev);
|
struct ata_host *host = dev_get_drvdata(&pdev->dev);
|
||||||
|
int rc;
|
||||||
|
|
||||||
ata_pci_device_do_resume(pdev);
|
rc = ata_pci_device_do_resume(pdev);
|
||||||
ata_host_resume(host);
|
if (rc == 0)
|
||||||
return 0;
|
ata_host_resume(host);
|
||||||
|
return rc;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_PCI */
|
#endif /* CONFIG_PCI */
|
||||||
|
|
||||||
|
|
|
@ -710,8 +710,12 @@ err_out:
|
||||||
static int sil_pci_device_resume(struct pci_dev *pdev)
|
static int sil_pci_device_resume(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
struct ata_host *host = dev_get_drvdata(&pdev->dev);
|
struct ata_host *host = dev_get_drvdata(&pdev->dev);
|
||||||
|
int rc;
|
||||||
|
|
||||||
|
rc = ata_pci_device_do_resume(pdev);
|
||||||
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
ata_pci_device_do_resume(pdev);
|
|
||||||
sil_init_controller(pdev, host->n_ports, host->ports[0]->flags,
|
sil_init_controller(pdev, host->n_ports, host->ports[0]->flags,
|
||||||
host->mmio_base);
|
host->mmio_base);
|
||||||
ata_host_resume(host);
|
ata_host_resume(host);
|
||||||
|
|
|
@ -1200,8 +1200,11 @@ static int sil24_pci_device_resume(struct pci_dev *pdev)
|
||||||
{
|
{
|
||||||
struct ata_host *host = dev_get_drvdata(&pdev->dev);
|
struct ata_host *host = dev_get_drvdata(&pdev->dev);
|
||||||
struct sil24_host_priv *hpriv = host->private_data;
|
struct sil24_host_priv *hpriv = host->private_data;
|
||||||
|
int rc;
|
||||||
|
|
||||||
ata_pci_device_do_resume(pdev);
|
rc = ata_pci_device_do_resume(pdev);
|
||||||
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND)
|
if (pdev->dev.power.power_state.event == PM_EVENT_SUSPEND)
|
||||||
writel(HOST_CTRL_GLOBAL_RST, hpriv->host_base + HOST_CTRL);
|
writel(HOST_CTRL_GLOBAL_RST, hpriv->host_base + HOST_CTRL);
|
||||||
|
|
|
@ -716,7 +716,7 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i
|
||||||
unsigned int n_ports);
|
unsigned int n_ports);
|
||||||
extern void ata_pci_remove_one (struct pci_dev *pdev);
|
extern void ata_pci_remove_one (struct pci_dev *pdev);
|
||||||
extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg);
|
extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg);
|
||||||
extern void ata_pci_device_do_resume(struct pci_dev *pdev);
|
extern int __must_check ata_pci_device_do_resume(struct pci_dev *pdev);
|
||||||
extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
|
extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
|
||||||
extern int ata_pci_device_resume(struct pci_dev *pdev);
|
extern int ata_pci_device_resume(struct pci_dev *pdev);
|
||||||
extern int ata_pci_clear_simplex(struct pci_dev *pdev);
|
extern int ata_pci_clear_simplex(struct pci_dev *pdev);
|
||||||
|
|
Loading…
Reference in New Issue