diff options
author | Paul Cercueil <paul@crapouillou.net> | 2020-07-16 14:42:48 +0200 |
---|---|---|
committer | Oleksandr Suvorov <oleksandr.suvorov@toradex.com> | 2021-07-08 14:42:13 +0300 |
commit | 0f3f096456594c6069d751276d64bd4cdd36bdca (patch) | |
tree | f9f1e8c49a2801ee7ff77bd99160cb42df8341e8 /include/linux/pm.h | |
parent | b155c237a5235a845c2608e0bc56a9c8569ef337 (diff) |
PM: core: introduce pm_ptr() macro
commit 7a82e97a11b91a78e9da06ab3f70545953c07b5c upstream
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 <paul@crapouillou.net>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/pm.h')
-rw-r--r-- | include/linux/pm.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/pm.h b/include/linux/pm.h index c1d21e9a864f..549f139442ad 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -374,6 +374,12 @@ const struct dev_pm_ops name = { \ SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ } +#ifdef CONFIG_PM +#define pm_ptr(_ptr) (_ptr) +#else +#define pm_ptr(_ptr) NULL +#endif + /* * PM_EVENT_ messages * |