提交 b6e335ae 编写于 作者: R Rafael J. Wysocki 提交者: Jesse Barnes

PCI/PM: Use pm_wakeup_event() directly for reporting wakeup events

After recent changes related to wakeup events pm_wakeup_event()
automatically checks if the given device is configured to signal wakeup,
so pci_wakeup_event() may be a static inline function calling
pm_wakeup_event() directly.
Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
上级 ff29530e
...@@ -1297,22 +1297,6 @@ bool pci_check_pme_status(struct pci_dev *dev) ...@@ -1297,22 +1297,6 @@ bool pci_check_pme_status(struct pci_dev *dev)
return ret; return ret;
} }
/*
* Time to wait before the system can be put into a sleep state after reporting
* a wakeup event signaled by a PCI device.
*/
#define PCI_WAKEUP_COOLDOWN 100
/**
* pci_wakeup_event - Report a wakeup event related to a given PCI device.
* @dev: Device to report the wakeup event for.
*/
void pci_wakeup_event(struct pci_dev *dev)
{
if (device_may_wakeup(&dev->dev))
pm_wakeup_event(&dev->dev, PCI_WAKEUP_COOLDOWN);
}
/** /**
* pci_pme_wakeup - Wake up a PCI device if its PME Status bit is set. * pci_pme_wakeup - Wake up a PCI device if its PME Status bit is set.
* @dev: Device to handle. * @dev: Device to handle.
......
...@@ -74,6 +74,12 @@ extern void pci_pm_init(struct pci_dev *dev); ...@@ -74,6 +74,12 @@ 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);
static inline void pci_wakeup_event(struct pci_dev *dev)
{
/* Wait 100 ms before the system can be put into a sleep state. */
pm_wakeup_event(&dev->dev, 100);
}
static inline bool pci_is_bridge(struct pci_dev *pci_dev) static inline bool pci_is_bridge(struct pci_dev *pci_dev)
{ {
return !!(pci_dev->subordinate); return !!(pci_dev->subordinate);
......
...@@ -820,7 +820,6 @@ int pci_prepare_to_sleep(struct pci_dev *dev); ...@@ -820,7 +820,6 @@ int pci_prepare_to_sleep(struct pci_dev *dev);
int pci_back_from_sleep(struct pci_dev *dev); int pci_back_from_sleep(struct pci_dev *dev);
bool pci_dev_run_wake(struct pci_dev *dev); bool pci_dev_run_wake(struct pci_dev *dev);
bool pci_check_pme_status(struct pci_dev *dev); bool pci_check_pme_status(struct pci_dev *dev);
void pci_wakeup_event(struct pci_dev *dev);
void pci_pme_wakeup_bus(struct pci_bus *bus); void pci_pme_wakeup_bus(struct pci_bus *bus);
static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册