mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-19 18:19:38 -05:00
PM: runtime: Define pm_runtime_put cleanup helper
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
This commit is contained in:
committed by
Bjorn Helgaas
parent
0af2f6be1b
commit
bfa4477751
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user