From 9a3df1f7de0ecaf77a1dde86f2a4dc020f37f87e Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Wed, 19 Mar 2008 22:39:13 +0100 Subject: 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 Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- include/linux/pm.h | 46 +--------------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) (limited to 'include/linux/pm.h') diff --git a/include/linux/pm.h b/include/linux/pm.h index 3342627e2bd..1de72cbbe0d 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 -- cgit v1.2.3