Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127423
b: refs/heads/master
c: ad8cfa1
h: refs/heads/master
i:
  127421: 593a050
  127419: ab38ecd
  127415: 591dbab
  127407: 106d1f6
  127391: 6e92801
  127359: 3da4efa
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Jesse Barnes committed Jan 7, 2009
1 parent 565927c commit 2c11b2a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bb8089454391ac5577215aec1f1991adcd4b4cbf
refs/heads/master: ad8cfa1defee14a5181d9b63e666318c51cfaeed
52 changes: 19 additions & 33 deletions trunk/drivers/pci/pci-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ static int pci_legacy_suspend(struct device *dev, pm_message_t state)
*/
pci_pm_set_unknown_state(pci_dev);
}

pci_fixup_device(pci_fixup_suspend, pci_dev);

return i;
}

Expand All @@ -387,6 +390,8 @@ static int pci_legacy_resume(struct device *dev)
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 {
Expand All @@ -403,6 +408,8 @@ static int pci_legacy_resume_early(struct device *dev)
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;
Expand Down Expand Up @@ -526,10 +533,8 @@ static int pci_pm_suspend(struct device *dev)
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) {
Expand All @@ -540,7 +545,6 @@ static int pci_pm_suspend(struct device *dev)
pci_pm_default_suspend(pci_dev);
}

Exit:
pci_fixup_device(pci_fixup_suspend, pci_dev);

return error;
Expand Down Expand Up @@ -573,10 +577,8 @@ static int pci_pm_resume(struct device *dev)
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);
Expand All @@ -596,10 +598,8 @@ static int pci_pm_resume_noirq(struct device *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);
Expand Down Expand Up @@ -630,11 +630,8 @@ static int pci_pm_freeze(struct device *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) {
Expand Down Expand Up @@ -675,10 +672,8 @@ static int pci_pm_thaw(struct device *dev)
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)
Expand All @@ -696,10 +691,8 @@ static int pci_pm_thaw_noirq(struct device *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, 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)
Expand All @@ -717,10 +710,8 @@ static int pci_pm_poweroff(struct device *dev)
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) {
Expand All @@ -731,7 +722,6 @@ static int pci_pm_poweroff(struct device *dev)
pci_pm_default_suspend(pci_dev);
}

Exit:
pci_fixup_device(pci_fixup_suspend, pci_dev);

return error;
Expand Down Expand Up @@ -761,10 +751,8 @@ static int pci_pm_restore(struct device *dev)
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);
Expand All @@ -784,10 +772,8 @@ static int pci_pm_restore_noirq(struct device *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);
Expand Down

0 comments on commit 2c11b2a

Please sign in to comment.