diff options
| -rw-r--r-- | drivers/pci/pci-driver.c | 17 | ||||
| -rw-r--r-- | drivers/pci/pci.c | 21 | ||||
| -rw-r--r-- | drivers/pci/pci.h | 1 |
3 files changed, 17 insertions, 22 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); |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 3acb1da296d5..a4ecc2f15126 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -1374,27 +1374,6 @@ void pci_allocate_cap_save_buffers(struct pci_dev *dev) | |||
| 1374 | } | 1374 | } |
| 1375 | 1375 | ||
| 1376 | /** | 1376 | /** |
| 1377 | * pci_restore_standard_config - restore standard config registers of PCI device | ||
| 1378 | * @dev: PCI device to handle | ||
| 1379 | * | ||
| 1380 | * This function assumes that the device's configuration space is accessible. | ||
| 1381 | * If the device needs to be powered up, the function will wait for it to | ||
| 1382 | * change the state. | ||
| 1383 | */ | ||
| 1384 | int pci_restore_standard_config(struct pci_dev *dev) | ||
| 1385 | { | ||
| 1386 | pci_update_current_state(dev, PCI_UNKNOWN); | ||
| 1387 | |||
| 1388 | if (dev->current_state != PCI_D0) { | ||
| 1389 | int error = pci_set_power_state(dev, PCI_D0); | ||
| 1390 | if (error) | ||
| 1391 | return error; | ||
| 1392 | } | ||
| 1393 | |||
| 1394 | return dev->state_saved ? pci_restore_state(dev) : 0; | ||
| 1395 | } | ||
| 1396 | |||
| 1397 | /** | ||
| 1398 | * pci_enable_ari - enable ARI forwarding if hardware support it | 1377 | * pci_enable_ari - enable ARI forwarding if hardware support it |
| 1399 | * @dev: the PCI device | 1378 | * @dev: the PCI device |
| 1400 | */ | 1379 | */ |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 07c0aa5275e6..149fff65891f 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
| @@ -49,7 +49,6 @@ extern void pci_disable_enabled_device(struct pci_dev *dev); | |||
| 49 | extern void pci_pm_init(struct pci_dev *dev); | 49 | extern void pci_pm_init(struct pci_dev *dev); |
| 50 | extern void platform_pci_wakeup_init(struct pci_dev *dev); | 50 | extern void platform_pci_wakeup_init(struct pci_dev *dev); |
| 51 | extern void pci_allocate_cap_save_buffers(struct pci_dev *dev); | 51 | extern void pci_allocate_cap_save_buffers(struct pci_dev *dev); |
| 52 | extern int pci_restore_standard_config(struct pci_dev *dev); | ||
| 53 | 52 | ||
| 54 | static inline bool pci_is_bridge(struct pci_dev *pci_dev) | 53 | static inline bool pci_is_bridge(struct pci_dev *pci_dev) |
| 55 | { | 54 | { |
