summaryrefslogtreecommitdiff
path: root/rust/kernel/devres.rs
diff options
context:
space:
mode:
authorDanilo Krummrich <dakr@kernel.org>2025-01-07 15:25:10 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-10 17:49:06 +0300
commitf1725160fd28a2e65e47166637aa44856a1a7f89 (patch)
treec18de29fa84d957ef2f1b80cc9f6deb96fc77137 /rust/kernel/devres.rs
parent827ed8b1590d4d29dae837283d606709ffeebe37 (diff)
downloadlinux-f1725160fd28a2e65e47166637aa44856a1a7f89.tar.xz
devres: add devm_remove_action_nowarn()
devm_remove_action() warns if the action to remove does not exist (anymore). The Rust devres abstraction, however, has a use-case to call devm_remove_action() at a point where it can't be guaranteed that the corresponding action hasn't been released yet. In particular, an instance of `Devres<T>` may be dropped after the action has been released. So far, `Devres<T>` worked around this by keeping the inner type alive. Hence, add devm_remove_action_nowarn(), which returns an error code if the action has been removed already. A subsequent patch uses devm_remove_action_nowarn() to remove the action when `Devres<T>` is dropped. Signed-off-by: Danilo Krummrich <dakr@kernel.org> Link: https://lore.kernel.org/r/20250107122609.8135-1-dakr@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'rust/kernel/devres.rs')
0 files changed, 0 insertions, 0 deletions