]> www.infradead.org Git - users/jedix/linux-maple.git/commit
rust: devres: do not dereference to the internal Revocable
authorDanilo Krummrich <dakr@kernel.org>
Wed, 11 Jun 2025 17:48:25 +0000 (19:48 +0200)
committerDanilo Krummrich <dakr@kernel.org>
Fri, 13 Jun 2025 21:48:53 +0000 (23:48 +0200)
commit20c96ed278e362ae4e324ed7d8c69fb48c508d3c
treefc52dbfda02c52bdf4979558fa2611248916cf52
parentf744201c6159fc7323c40936fd079525f7063598
rust: devres: do not dereference to the internal Revocable

We can't expose direct access to the internal Revocable, since this
allows users to directly revoke the internal Revocable without Devres
having the chance to synchronize with the devres callback -- we have to
guarantee that the internal Revocable has been fully revoked before
the device is fully unbound.

Hence, remove the corresponding Deref implementation and, instead,
provide indirect accessors for the internal Revocable.

Note that we can still support Devres::revoke() by implementing the
required synchronization (which would be almost identical to the
synchronization in Devres::drop()).

Fixes: 76c01ded724b ("rust: add devres abstraction")
Reviewed-by: Benno Lossin <lossin@kernel.org>
Link: https://lore.kernel.org/r/20250611174827.380555-1-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/devres.rs