Skip to content

Commit 7a82e97

Browse files
pcercueirafaeljw
authored andcommitted
PM: core: introduce pm_ptr() macro
This macro is analogous to the infamous of_match_ptr(). If CONFIG_PM is enabled, this macro will resolve to its argument, otherwise to NULL. Signed-off-by: Paul Cercueil <[email protected]> Reviewed-by: Ulf Hansson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 92ed301 commit 7a82e97

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/linux/pm.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,12 @@ const struct dev_pm_ops name = { \
374374
SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
375375
}
376376

377+
#ifdef CONFIG_PM
378+
#define pm_ptr(_ptr) (_ptr)
379+
#else
380+
#define pm_ptr(_ptr) NULL
381+
#endif
382+
377383
/*
378384
* PM_EVENT_ messages
379385
*

0 commit comments

Comments
 (0)