PM: Create PM workqueue if runtime PM is not configured too
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 22 Jul 2014 23:00:36 +0000 (01:00 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 22 Jul 2014 23:00:36 +0000 (01:00 +0200)
The PM workqueue is going to be used by ACPI PM notify handlers
regardless of whether or not runtime PM is configured, so move
it out of #ifdef CONFIG_PM_RUNTIME.

Do that in three places in the ACPI device PM code.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
include/linux/pm_runtime.h
kernel/power/main.c

index 43fd6716f66207bc824b94f1fdbfb44bc37d3534..367f49b9a1c93e5f48ede4b0b97d09ce4f73ce3e 100644 (file)
 #define RPM_AUTO               0x08    /* Use autosuspend_delay */
 
 #ifdef CONFIG_PM
+extern struct workqueue_struct *pm_wq;
+
+static inline bool queue_pm_work(struct work_struct *work)
+{
+       return queue_work(pm_wq, work);
+}
+
 extern int pm_generic_runtime_suspend(struct device *dev);
 extern int pm_generic_runtime_resume(struct device *dev);
 extern int pm_runtime_force_suspend(struct device *dev);
 extern int pm_runtime_force_resume(struct device *dev);
 #else
+static inline bool queue_pm_work(struct work_struct *work) { return false; }
+
 static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
 static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
 static 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; }
 
 #ifdef CONFIG_PM_RUNTIME
 
-extern struct workqueue_struct *pm_wq;
-
 extern int __pm_runtime_idle(struct device *dev, int rpmflags);
 extern int __pm_runtime_suspend(struct device *dev, int rpmflags);
 extern int __pm_runtime_resume(struct device *dev, int rpmflags);
index 8e90f330f1398277d1b41b0e94c99e71759e2665..a18efed75fa7ea75083f523132ad0c5ab338d1e6 100644 (file)
@@ -615,7 +615,6 @@ static struct attribute_group attr_group = {
        .attrs = g,
 };
 
-#ifdef CONFIG_PM_RUNTIME
 struct workqueue_struct *pm_wq;
 EXPORT_SYMBOL_GPL(pm_wq);
 
@@ -625,9 +624,6 @@ static int __init pm_start_workqueue(void)
 
        return pm_wq ? 0 : -ENOMEM;
 }
-#else
-static inline int pm_start_workqueue(void) { return 0; }
-#endif
 
 static int __init pm_init(void)
 {
This page took 0.025638 seconds and 5 git commands to generate.