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>
This commit is contained in:
parent
f00a20ef46
commit
0128a89cf7
|
@ -423,6 +423,23 @@ static int pci_legacy_resume(struct device *dev)
|
||||||
|
|
||||||
/* Auxiliary functions used by the new power management framework */
|
/* Auxiliary functions used by the new power management framework */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pci_restore_standard_config - restore standard config registers of PCI device
|
||||||
|
* @pci_dev: PCI device to handle
|
||||||
|
*/
|
||||||
|
static int pci_restore_standard_config(struct pci_dev *pci_dev)
|
||||||
|
{
|
||||||
|
pci_update_current_state(pci_dev, PCI_UNKNOWN);
|
||||||
|
|
||||||
|
if (pci_dev->current_state != PCI_D0) {
|
||||||
|
int error = pci_set_power_state(pci_dev, PCI_D0);
|
||||||
|
if (error)
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
return pci_dev->state_saved ? pci_restore_state(pci_dev) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void pci_pm_default_resume_noirq(struct pci_dev *pci_dev)
|
static void pci_pm_default_resume_noirq(struct pci_dev *pci_dev)
|
||||||
{
|
{
|
||||||
pci_restore_standard_config(pci_dev);
|
pci_restore_standard_config(pci_dev);
|
||||||
|
|
|
@ -1373,27 +1373,6 @@ void pci_allocate_cap_save_buffers(struct pci_dev *dev)
|
||||||
"unable to preallocate PCI-X save buffer\n");
|
"unable to preallocate PCI-X save buffer\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* pci_restore_standard_config - restore standard config registers of PCI device
|
|
||||||
* @dev: PCI device to handle
|
|
||||||
*
|
|
||||||
* This function assumes that the device's configuration space is accessible.
|
|
||||||
* If the device needs to be powered up, the function will wait for it to
|
|
||||||
* change the state.
|
|
||||||
*/
|
|
||||||
int pci_restore_standard_config(struct pci_dev *dev)
|
|
||||||
{
|
|
||||||
pci_update_current_state(dev, PCI_UNKNOWN);
|
|
||||||
|
|
||||||
if (dev->current_state != PCI_D0) {
|
|
||||||
int error = pci_set_power_state(dev, PCI_D0);
|
|
||||||
if (error)
|
|
||||||
return error;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dev->state_saved ? pci_restore_state(dev) : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pci_enable_ari - enable ARI forwarding if hardware support it
|
* pci_enable_ari - enable ARI forwarding if hardware support it
|
||||||
* @dev: the PCI device
|
* @dev: the PCI device
|
||||||
|
|
|
@ -49,7 +49,6 @@ extern void pci_disable_enabled_device(struct pci_dev *dev);
|
||||||
extern void pci_pm_init(struct pci_dev *dev);
|
extern void pci_pm_init(struct pci_dev *dev);
|
||||||
extern void platform_pci_wakeup_init(struct pci_dev *dev);
|
extern void platform_pci_wakeup_init(struct pci_dev *dev);
|
||||||
extern void pci_allocate_cap_save_buffers(struct pci_dev *dev);
|
extern void pci_allocate_cap_save_buffers(struct pci_dev *dev);
|
||||||
extern int pci_restore_standard_config(struct pci_dev *dev);
|
|
||||||
|
|
||||||
static inline bool pci_is_bridge(struct pci_dev *pci_dev)
|
static inline bool pci_is_bridge(struct pci_dev *pci_dev)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue