diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2008-03-20 00:39:13 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-20 06:10:26 +0400 |
commit | 9a3df1f7de0ecaf77a1dde86f2a4dc020f37f87e (patch) | |
tree | 599a884cf4b42c516226c0f845cd32d0295b74ed /include/linux/pm.h | |
parent | d288e47c471e1090e80c62ad95882fafbf3f499d (diff) | |
download | linux-9a3df1f7de0ecaf77a1dde86f2a4dc020f37f87e.tar.xz |
PM: Convert wakeup flag accessors to inline functions
This patch (as1058) improves the wakeup macros in include/linux/pm.h.
All but the trivial ones are converted to inline routines, which
requires moving them to a separate header file since they depend on
the definition of struct device.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r-- | include/linux/pm.h | 46 |
1 files changed, 1 insertions, 45 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index 3342627e2bd6..1de72cbbe0d1 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -212,54 +212,10 @@ static inline int device_suspend(pm_message_t state) return 0; } -#define suspend_report_result(fn, ret) do { } while (0) +#define suspend_report_result(fn, ret) do {} while (0) #endif /* !CONFIG_PM_SLEEP */ -#ifdef CONFIG_PM - -#define device_set_wakeup_enable(dev,val) \ - ((dev)->power.should_wakeup = !!(val)) -#define device_may_wakeup(dev) \ - (device_can_wakeup(dev) && (dev)->power.should_wakeup) - -/* - * Platform hook to activate device wakeup capability, if that's not already - * handled by enable_irq_wake() etc. - * Returns zero on success, else negative errno - */ -extern int (*platform_enable_wakeup)(struct device *dev, int is_on); - -static inline int call_platform_enable_wakeup(struct device *dev, int is_on) -{ - if (platform_enable_wakeup) - return (*platform_enable_wakeup)(dev, is_on); - return 0; -} - -#else /* !CONFIG_PM */ - -#define device_set_wakeup_enable(dev,val) do{}while(0) -#define device_may_wakeup(dev) (0) - -static inline int call_platform_enable_wakeup(struct device *dev, int is_on) -{ - return 0; -} - -#endif /* !CONFIG_PM */ - -/* changes to device_may_wakeup take effect on the next pm state change. - * by default, devices should wakeup if they can. - */ -#define device_can_wakeup(dev) \ - ((dev)->power.can_wakeup) -#define device_init_wakeup(dev,val) \ - do { \ - device_can_wakeup(dev) = !!(val); \ - device_set_wakeup_enable(dev,val); \ - } while(0) - /* * Global Power Management flags * Used to keep APM and ACPI from both being active |