aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/pm_runtime.h11
-rw-r--r--kernel/power/main.c4
2 files changed, 9 insertions, 6 deletions
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 43fd6716f662..367f49b9a1c9 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -24,11 +24,20 @@
24#define RPM_AUTO 0x08 /* Use autosuspend_delay */ 24#define RPM_AUTO 0x08 /* Use autosuspend_delay */
25 25
26#ifdef CONFIG_PM 26#ifdef CONFIG_PM
27extern struct workqueue_struct *pm_wq;
28
29static inline bool queue_pm_work(struct work_struct *work)
30{
31 return queue_work(pm_wq, work);
32}
33
27extern int pm_generic_runtime_suspend(struct device *dev); 34extern int pm_generic_runtime_suspend(struct device *dev);
28extern int pm_generic_runtime_resume(struct device *dev); 35extern int pm_generic_runtime_resume(struct device *dev);
29extern int pm_runtime_force_suspend(struct device *dev); 36extern int pm_runtime_force_suspend(struct device *dev);
30extern int pm_runtime_force_resume(struct device *dev); 37extern int pm_runtime_force_resume(struct device *dev);
31#else 38#else
39static inline bool queue_pm_work(struct work_struct *work) { return false; }
40
32static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } 41static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
33static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } 42static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
34static inline int pm_runtime_force_suspend(struct device *dev) { return 0; } 43static inline int pm_runtime_force_suspend(struct device *dev) { return 0; }
@@ -37,8 +46,6 @@ static inline int pm_runtime_force_resume(struct device *dev) { return 0; }
37 46
38#ifdef CONFIG_PM_RUNTIME 47#ifdef CONFIG_PM_RUNTIME
39 48
40extern struct workqueue_struct *pm_wq;
41
42extern int __pm_runtime_idle(struct device *dev, int rpmflags); 49extern int __pm_runtime_idle(struct device *dev, int rpmflags);
43extern int __pm_runtime_suspend(struct device *dev, int rpmflags); 50extern int __pm_runtime_suspend(struct device *dev, int rpmflags);
44extern int __pm_runtime_resume(struct device *dev, int rpmflags); 51extern int __pm_runtime_resume(struct device *dev, int rpmflags);
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 8e90f330f139..a18efed75fa7 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -615,7 +615,6 @@ static struct attribute_group attr_group = {
615 .attrs = g, 615 .attrs = g,
616}; 616};
617 617
618#ifdef CONFIG_PM_RUNTIME
619struct workqueue_struct *pm_wq; 618struct workqueue_struct *pm_wq;
620EXPORT_SYMBOL_GPL(pm_wq); 619EXPORT_SYMBOL_GPL(pm_wq);
621 620
@@ -625,9 +624,6 @@ static int __init pm_start_workqueue(void)
625 624
626 return pm_wq ? 0 : -ENOMEM; 625 return pm_wq ? 0 : -ENOMEM;
627} 626}
628#else
629static inline int pm_start_workqueue(void) { return 0; }
630#endif
631 627
632static int __init pm_init(void) 628static int __init pm_init(void)
633{ 629{