diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2009-03-16 17:40:18 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2009-03-30 15:46:55 -0400 |
commit | 0128a89cf75124500b5b69f0c3c7b7c5aa60676f (patch) | |
tree | 96cdc2c1dc62f2a543b11f481811efce59b1f0f7 /drivers/pci/pci-driver.c | |
parent | f00a20ef46b1795c495869163a9a7333f899713a (diff) |
PCI PM: Move pci_restore_standard_config to pci-driver.c
Move pci_restore_standard_config() from pci.c to pci-driver.c and
make it static.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r-- | drivers/pci/pci-driver.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index a5f11ad975b2..8395206d1aee 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -423,6 +423,23 @@ static int pci_legacy_resume(struct device *dev) | |||
423 | 423 | ||
424 | /* Auxiliary functions used by the new power management framework */ | 424 | /* Auxiliary functions used by the new power management framework */ |
425 | 425 | ||
426 | /** | ||
427 | * pci_restore_standard_config - restore standard config registers of PCI device | ||
428 | * @pci_dev: PCI device to handle | ||
429 | */ | ||
430 | static int pci_restore_standard_config(struct pci_dev *pci_dev) | ||
431 | { | ||
432 | pci_update_current_state(pci_dev, PCI_UNKNOWN); | ||
433 | |||
434 | if (pci_dev->current_state != PCI_D0) { | ||
435 | int error = pci_set_power_state(pci_dev, PCI_D0); | ||
436 | if (error) | ||
437 | return error; | ||
438 | } | ||
439 | |||
440 | return pci_dev->state_saved ? pci_restore_state(pci_dev) : 0; | ||
441 | } | ||
442 | |||
426 | static void pci_pm_default_resume_noirq(struct pci_dev *pci_dev) | 443 | static void pci_pm_default_resume_noirq(struct pci_dev *pci_dev) |
427 | { | 444 | { |
428 | pci_restore_standard_config(pci_dev); | 445 | pci_restore_standard_config(pci_dev); |