]> git.ipfire.org Git - thirdparty/linux.git/commit
rust: device: implement Device::as_bound()
authorDanilo Krummrich <dakr@kernel.org>
Sun, 13 Jul 2025 18:26:54 +0000 (20:26 +0200)
committerDanilo Krummrich <dakr@kernel.org>
Tue, 15 Jul 2025 12:56:56 +0000 (14:56 +0200)
commit47e6715bb7ea388a9a3a13d31918827ba3aa3f4a
tree1a3f529f290c9e1b9cddaf8c84b6a9217313dd1f
parent85aa5b16fef7040213581df9ff093dae27bf8675
rust: device: implement Device::as_bound()

Provide an unsafe functions for abstractions to convert a regular
&Device to a &Device<Bound>.

This is useful for registrations that provide certain guarantees for the
scope of their callbacks, such as IRQs or certain class device
registrations (e.g. PWM, miscdevice).

Reviewed-by: Benno Lossin <lossin@kernel.org>
Link: https://lore.kernel.org/r/20250713182737.64448-2-dakr@kernel.org
[ Remove unnecessary cast(). - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
rust/kernel/device.rs