diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-10-01 19:34:29 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2025-10-03 21:09:54 +0200 |
commit | 384b52ce32110db974d3b61d463af48347eb73fb (patch) | |
tree | d68d34a5b4e4dd704bbab5fa8cca373abd02e5bc | |
parent | d5e58ce1fb0f13a9a0845851f267ede3551cd9fe (diff) |
PM: runtime: Introduce one more usage counter guard
Follow previous commit 9a0abc39450a ("PM: runtime: Add auto-cleanup
macros for "resume and get" operations") and define a runtime PM
usage counter guard in which pm_runtime_get_noresume() and
pm_runtime_put_noidle() will be used for incrementing and
decrementing it, respectively.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameorn@huawei.com>
-rw-r--r-- | include/linux/pm_runtime.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index edb8aed5ef62..a3f44f6c2da1 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -614,6 +614,9 @@ static inline int pm_runtime_put_autosuspend(struct device *dev) return __pm_runtime_put_autosuspend(dev); } +DEFINE_GUARD(pm_runtime_noresume, struct device *, + pm_runtime_get_noresume(_T), pm_runtime_put_noidle(_T)); + DEFINE_GUARD(pm_runtime_active, struct device *, pm_runtime_get_sync(_T), pm_runtime_put(_T)); DEFINE_GUARD(pm_runtime_active_auto, struct device *, |