projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0af2f6b
)
PM: runtime: Define pm_runtime_put cleanup helper
author
Alex Williamson
<alex.williamson@redhat.com>
Tue, 22 Apr 2025 23:05:31 +0000
(17:05 -0600)
committer
Bjorn Helgaas
<bhelgaas@google.com>
Wed, 23 Apr 2025 21:05:50 +0000
(16:05 -0500)
Define a cleanup helper for use with __free to automatically drop the
device usage count when the pointer goes out of scope.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Link:
https://patch.msgid.link/20250422230534.2295291-2-alex.williamson@redhat.com
include/linux/pm_runtime.h
patch
|
blob
|
blame
|
history
diff --git
a/include/linux/pm_runtime.h
b/include/linux/pm_runtime.h
index 7fb5a459847ef3bdaf89a6b9be8dc0474199c577..69d4b2929ee6e884e095cbdfee817fcaa5db02aa 100644
(file)
--- a/
include/linux/pm_runtime.h
+++ b/
include/linux/pm_runtime.h
@@
-466,6
+466,8
@@
static inline int pm_runtime_put(struct device *dev)
return __pm_runtime_idle(dev, RPM_GET_PUT | RPM_ASYNC);
}
+DEFINE_FREE(pm_runtime_put, struct device *, if (_T) pm_runtime_put(_T))
+
/**
* __pm_runtime_put_autosuspend - Drop device usage counter and queue autosuspend if 0.
* @dev: Target device.