Skip to content

Commit d59ff7d

Browse files
pcercueirafaeljw
authored andcommitted
PM: runtime: Add EXPORT[_GPL]_RUNTIME_DEV_PM_OPS macros
Similar to EXPORT[_GPL]_SIMPLE_DEV_PM_OPS, but for users with runtime-PM suspend/resume callbacks. Signed-off-by: Paul Cercueil <paul@crapouillou.net> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 9d86191 commit d59ff7d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

include/linux/pm_runtime.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,22 @@
3030
* macro, which uses the provided callbacks for both runtime PM and system
3131
* sleep, while DEFINE_RUNTIME_DEV_PM_OPS() uses pm_runtime_force_suspend()
3232
* and pm_runtime_force_resume() for its system sleep callbacks.
33+
*
34+
* If the underlying dev_pm_ops struct symbol has to be exported, use
35+
* EXPORT_RUNTIME_DEV_PM_OPS() or EXPORT_GPL_RUNTIME_DEV_PM_OPS() instead.
3336
*/
3437
#define DEFINE_RUNTIME_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \
3538
_DEFINE_DEV_PM_OPS(name, pm_runtime_force_suspend, \
3639
pm_runtime_force_resume, suspend_fn, \
3740
resume_fn, idle_fn)
3841

42+
#define EXPORT_RUNTIME_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \
43+
_EXPORT_DEV_PM_OPS(name, pm_runtime_force_suspend, pm_runtime_force_resume, \
44+
suspend_fn, resume_fn, idle_fn, "")
45+
#define EXPORT_GPL_RUNTIME_DEV_PM_OPS(name, suspend_fn, resume_fn, idle_fn) \
46+
_EXPORT_DEV_PM_OPS(name, pm_runtime_force_suspend, pm_runtime_force_resume, \
47+
suspend_fn, resume_fn, idle_fn, "_gpl")
48+
3949
#ifdef CONFIG_PM
4050
extern struct workqueue_struct *pm_wq;
4151

0 commit comments

Comments
 (0)