*/
pci_pm_set_unknown_state(pci_dev);
}
+
+ pci_fixup_device(pci_fixup_suspend, pci_dev);
+
return i;
}
struct pci_dev * pci_dev = to_pci_dev(dev);
struct pci_driver * drv = pci_dev->driver;
+ pci_fixup_device(pci_fixup_resume, pci_dev);
+
if (drv && drv->resume) {
error = drv->resume(pci_dev);
} else {
struct pci_dev * pci_dev = to_pci_dev(dev);
struct pci_driver * drv = pci_dev->driver;
+ pci_fixup_device(pci_fixup_resume_early, pci_dev);
+
if (drv && drv->resume_early)
error = drv->resume_early(pci_dev);
return error;
struct device_driver *drv = dev->driver;
int error = 0;
- if (pci_has_legacy_pm_support(pci_dev)) {
- error = pci_legacy_suspend(dev, PMSG_SUSPEND);
- goto Exit;
- }
+ if (pci_has_legacy_pm_support(pci_dev))
+ return pci_legacy_suspend(dev, PMSG_SUSPEND);
if (drv && drv->pm) {
if (drv->pm->suspend) {
pci_pm_default_suspend(pci_dev);
}
- Exit:
pci_fixup_device(pci_fixup_suspend, pci_dev);
return error;
struct device_driver *drv = dev->driver;
int error = 0;
- if (pci_has_legacy_pm_support(pci_dev)) {
- pci_fixup_device(pci_fixup_resume, pci_dev);
+ if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_resume(dev);
- }
if (drv && drv->pm) {
pci_fixup_device(pci_fixup_resume, pci_dev);
struct device_driver *drv = dev->driver;
int error = 0;
- if (pci_has_legacy_pm_support(pci_dev)) {
- pci_fixup_device(pci_fixup_resume_early, pci_dev);
+ if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_resume_early(dev);
- }
if (drv && drv->pm) {
pci_fixup_device(pci_fixup_resume_early, pci_dev);
struct device_driver *drv = dev->driver;
int error = 0;
- if (pci_has_legacy_pm_support(pci_dev)) {
- error = pci_legacy_suspend(dev, PMSG_FREEZE);
- pci_fixup_device(pci_fixup_suspend, pci_dev);
- return error;
- }
+ if (pci_has_legacy_pm_support(pci_dev))
+ return pci_legacy_suspend(dev, PMSG_FREEZE);
if (drv && drv->pm) {
if (drv->pm->freeze) {
struct device_driver *drv = dev->driver;
int error = 0;
- if (pci_has_legacy_pm_support(pci_dev)) {
- pci_fixup_device(pci_fixup_resume, pci_dev);
+ if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_resume(dev);
- }
if (drv && drv->pm) {
if (drv->pm->thaw)
struct device_driver *drv = dev->driver;
int error = 0;
- if (pci_has_legacy_pm_support(pci_dev)) {
- pci_fixup_device(pci_fixup_resume_early, to_pci_dev(dev));
+ if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_resume_early(dev);
- }
if (drv && drv->pm) {
if (drv->pm->thaw_noirq)
struct device_driver *drv = dev->driver;
int error = 0;
- if (pci_has_legacy_pm_support(pci_dev)) {
- error = pci_legacy_suspend(dev, PMSG_HIBERNATE);
- goto Exit;
- }
+ if (pci_has_legacy_pm_support(pci_dev))
+ return pci_legacy_suspend(dev, PMSG_HIBERNATE);
if (drv && drv->pm) {
if (drv->pm->poweroff) {
pci_pm_default_suspend(pci_dev);
}
- Exit:
pci_fixup_device(pci_fixup_suspend, pci_dev);
return error;
struct device_driver *drv = dev->driver;
int error = 0;
- if (pci_has_legacy_pm_support(pci_dev)) {
- pci_fixup_device(pci_fixup_resume, pci_dev);
+ if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_resume(dev);
- }
if (drv && drv->pm) {
pci_fixup_device(pci_fixup_resume, pci_dev);
struct device_driver *drv = dev->driver;
int error = 0;
- if (pci_has_legacy_pm_support(pci_dev)) {
- pci_fixup_device(pci_fixup_resume_early, pci_dev);
+ if (pci_has_legacy_pm_support(pci_dev))
return pci_legacy_resume_early(dev);
- }
if (drv && drv->pm) {
pci_fixup_device(pci_fixup_resume_early, pci_dev);